edit

Nginx-vod-module

特性

实时将MP4转换为DASH,HDS,HLS,MSS
工作模式1:Local本地模式,使用本地文件提供服务
工作模式2:Remote远程模式,使用HTTP分段请求提供服务
工作模式3:Mapped映射模式,使用JSON编码请求从远程或本地文件提供服务
支持自适应码率
播放列表(Mapped映射模式)
模拟直播(Mapped映射模式)
文件未找到回溯(在多数据中心环境中有用)
视频编码:H264,H265(DASH/HLS),VP9(DASH)
音频编码:AAC,MP3
WebVTT/SRT字幕支持:1、DASH,2、HLS,3、MSS
支持Audio only/Video only文件
备用音轨支持1:生成多个音轨的manifest文件,在用户端选择
备用音轨支持2:单视频多音频文件多路复用,无需用户端支持
多音视频轨道选择
支持0.5-2倍变速(需要libavcodec和libavfilter)
源文件剪裁(I-Frame到P-frame)
支持可变分段长度-授权播放器选择最佳码率,防止过短分段
Clipping of MP4 files for progressive download playback
缩略图截取(需要libavcodec)
解密CENC加密的MP4文件(it is possible to create such files with MP4Box)
DASH: 通用加密(CENC)支持
MSS: PlayReady encryption support
HLS: Generation of I-frames playlist (EXT-X-I-FRAMES-ONLY)
HLS: 支持AES-128 / SAMPLE-AES加密

实际测试支持文件格式

mp4,mov
支持编码的avi文件

最佳视频参数

https://knowledge.kaltura.com/recommended-video-source-formats-and-specifications

建议的视频设置

File Recommended Avoid
Compressed Source H.264, ProRes
Container MOV, MP4
Bitrate x1.5-2 of the largest flavor
Frame Size As big as the largest desired flavor Don’t scale/zoom
Frame Size Multiples of 16 (see below)
Frame Size Keep the original Don’t re-sample

QuickTime MPEG-4 设置建议

MP4/MOV Streaming - choose Fast-Start.
MP4 Video Compression - choose H.264 High profile.
Bitrate – based on video dimensions. See table below.
Progressive scan mode – avoid interlaced (Kaltura can handle interlaced as well, but it’s not recommended).
Multi pass –multi-pass will provide better quality (although Kaltura can convert single-pass file as well).
VBR vs. CBR - VBR (variable bitrate) usually provides better quality than CBR (constant bitrate).
Frame Rate – choose Current.

不同视频尺寸建议码率

理想的码率是6-8kbps
带*号的是kaltrua的默认配置

16:9 4:3 Bitrate Range
*1920x1080 (1080p) 6,000-8,000 Kbps
*1280x720 (720p) 3,750-5,000 Kbps
*1024x720 (iPad) 3,750-5,000 Kbps
960x540 (540p)
720x405
640x360 640x480 1,350-1,800 Kbps
560x315 560x420
*480x270 480x360 600-800 Kbps
400x225 400x300
*320x180 320x240 600-800 Kbps

建议的音频编码设置

File Recommended Avoid
Compression AAC, MP3 Nellymoser
Channels Stereo, Mono Surround, 7.1
Sample Size 44.1 kHz or lower
Sound Levels Normalized Peaks, low sound

Best Practices For Multi-Device Transcoding

https://knowledge.kaltura.com/best-practices-multi-device-transcoding

ngx_http_hls支持的文件格式与编码格式

支持文件格式

The ngx_http_hls_module module provides HTTP Live Streaming (HLS) server-side support for MP4 and MOV media files.

通常后缀名

Such files typically have the .mp4, .m4v, .m4a, .mov, or .qt filename extensions.

支持编码格式

The module supports H.264 video codec, AAC and MP3 audio codecs.

限制

轨道选择和码率变化在progressive download下不支持
I-frames playlist generation is not supported when encryption is enabled
只在Linux下测试通过

安装

编译

cd到NGINX源代码目录执行

./configure --add-module=/path/to/nginx-vod-module
make
make install

异步I/O支持加--with-file-aio(强烈建议,只支持local和mapped模式)

./configure --add-module=/path/to/nginx-vod-module --with-file-aio

支持使用线程池异步打开文件(只支持nginx 1.7.11以上,local和mapped模式)

./configure -add-module=/path/to/nginx-vod-module --with-threads

gcc编译优化-O3,和-O比较可以提升8%的MP4解析速度和帧处理之间

./configure --add-module=/path/to/nginx-vod-module --with-cc-opt="-O3"

打印debug消息

./configure --add-module=/path/to/nginx-vod-module --with-debug

关闭编译优化(方便gdb调试)

./configure --add-module=/path/to/nginx-vod-module --with-cc-opt="-O0"

RHEL/CentOS RPM

RHEL or CentOS 6

rpm -ihv http://installrepo.kaltura.org/releases/kaltura-release.noarch.rpm
yum install kaltura-nginx

RHEL or CentOS 7

rpm -ihv http://installrepo.kaltura.org/releases/kaltura-release.noarch.rpm   

修改/etc/yum.repos.d/kaltura.repo

baseurl = http://installrepo.kaltura.org/releases/latest/RPMS/$basearch/

替换为

baseurl = http://installrepo.kaltura.org/releases/rhel7/RPMS/$basearch/

Debian/Ubuntu RPM

wget -O - http://installrepo.kaltura.org/repo/apt/debian/kaltura-deb.gpg.key|apt-key add -
echo "deb [arch=amd64] http://installrepo.kaltura.org/repo/apt/debian kajam main" > /etc/apt/sources.list.d/kaltura.list
apt-get update
apt-get install kaltura-nginx

注意

Ubuntu NOTE: You must also make sure the multiverse repo is enabled in /etc/apt/sources.list

URL结构

基本URL结构

结构

http://<domain>/<location>/<fileuri>/<filename>  

fileuri

local模式:根目录root /的相对路径
mapped模式:根据从upstream /收到的JSON确定
remote模式:读取chunks的mp4文件路径

多文件合一URL结构

多合一

http://<domain>/<location>/<prefix>,<middle1>,<middle2>,<middle3>,<postfix>.urlset/<filename>  

分解

http://<domain>/<location><prefix><middle1><postfix>/<filename>  
http://<domain>/<location><prefix><middle2><postfix>/<filename>  
http://<domain>/<location><prefix><middle3><postfix>/<filename>  

注意

The suffix .urlset (can be changed with vod_multi_uri_suffix) indicates that the URL should be treated as a multi URL.

URL路径参数

clipFrom:播放开始时间毫秒 例如 .../clipFrom/10000/...
clipTo: 播放结束时间毫秒 例如 .../clipTo/60000/...
tracks: 音视频轨道 例如 .../tracks/v1-a1/...

文件名结构

结构

<basename>[<seqparams>][<fileparams>][<trackparams>][<langparams>].<extension>  

basename

dash - manifest.mpd
hds - manifest.f4m
hls master playlist - master.m3u8
hls media playlist - index.m3u8
mss - manifest
thumb - thumb-.jpg (offset is the thumbnail video offset in milliseconds)

seqparams (sseq)

序号,如 master-sseq1.m3u8

fileparams (f)

多路复用参数,如manifest-f1.mpd

trackparams (t)

轨道参数,如manifest-a1.f4m
默认使用每个文件的第一个音轨和第一个视轨
与URL中/tracks/参数进行AND操作

langparams

语言音轨,如master-leng.m3u8

Mapping模式JSON响应格式

Mapping模式时,nginx-vod-module向配置的upstream上游服务器发出http请求,接收它应该生成的多媒体。
upstream上游服务器必须响应JSON格式。

示例字段说明准备

1、Source Clip 从单一媒体文件中提取的音视频轨道。
2、Filter 对音视频轨道的筛选、操作。速率变化/音量大小/min多个音轨混合。
3、Clip 经过一系列Source Clip和Filter操作之后得到的结果。
4、Sequence 一些列应该被顺序播放的Clip。
5、Set 几个分辨率不同自适应播放的Sequence,每个Sequence内的Clip必须相同。

示例:简单映射

请求单一MP4文件

{
    "sequences":[
        {
            "clips":[
                {
                    "type":"source",
                    "path":"/path/to/video.mp4"
                }
            ]
        }
    ]
}

示例:自适应集合

{
    "sequences":[
        {
            "clips":[
                "type":"source",
                "path":"/path/to/bitrate1.mp4"
            ]
        },
        {
            "clips":[
                "type":"source",
                "path":"/path/to/bitrate2.mp4"
            ]
        }
    ]
}

示例:播放列表

一个35秒的视频加一个22秒的视频

{
    "durations":[35000, 22000],
    "sequences":[
        {
            "clips":[
                "type":"source",
                "path":"/path/to/video1.mp4"
            ]
        },
        {
            "clips":[
                "type":"source",
                "path":"/path/to/video2.mp4"
            ]
        }
    ]
}

示例:过滤器

以1.5被速率播放视频1,混合使用50%音量的视频2的音轨

{
    "sequences": [
        {
            "clips": [
                {
                    "type": "mixFilter",
                    "sources": [
                        {
                            "type": "rateFilter",
                            "rate": 1.5,
                            "source": {
                                "type": "source",
                                "path": "/path/to/video1.mp4"
                            }
                        },
                        {
                            "type": "gainFilter",
                            "gain": 0.5,
                            "source": {
                                "type": "source",
                                "path": "/path/to/video2.mp4",
                                "tracks": "a1"
                            }
                        }
                    ]
                }
            ]
        }
    ]
}

示例:连续直播

{
    "playlistType": "live",
    "discontinuity": false,
    "segmentBaseTime": 1451904060000,
    "firstClipTime": 1451917506000,
    "durations": [83000, 83000],
    "sequences": [
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/path/to/video1.mp4"
                },
                {
                    "type": "source",
                    "path": "/path/to/video2.mp4"
                }
            ]
        }
    ]
}

示例:不连续直播

{
    "playlistType": "live",
    "discontinuity": true,
    "initialClipIndex": 171,
    "initialSegmentIndex": 153,
    "firstClipTime": 1451918170000,
    "durations": [83000, 83000],
    "sequences": [
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/path/to/video1.mp4"
                },
                {
                    "type": "source",
                    "path": "/path/to/video2.mp4"
                }
            ]
        }
    ]
}

Mapping模式参数说明

Set

Sequence

Clip(abstract)

Source clip

Rate filter clip

Gain filter clip

Mix filter clip

Concat clip

Dynamic clip

Notification

安全

鉴权

CDN分发

直接分发

URL加密

多媒体加密

DRM

性能建议

  1. 中型大型部署,不要让用户直接从nginx-vod-module播放,应该使用HTTP代理或CDN。
    中型部署添加一个缓存代理,使用nginx server的proxy_pass和proxy_cache。
    通常nginx-vod-module与mp4文件越近越好,缓存代理离用户越近越好。
  2. 开启nginx-vod-module缓存
    vod_metadata_cache,为每个分段保存需要重复读取的video metadata,缓存大小应该是GB级别。
    vod_response_cache,保存manifest清单请求,如果有中间代理层,这个缓存不是必须的,没有必要设置很大,128M一般够用。
    vod_mapping_cache,mapped模式,几MB即可。
    nginx's open_file_cache,缓存打开的文件句柄。
    打开vod_performance_counters可以跟踪命中率,启用一个nginx vod状态页面。
  3. 在local和mapped模式下,打开aio异步I/O,必须在编译时和配置时打开aio选项,可以通过状态页面的read_file(aio off)值对比async_read_file(aio on)。
  4. 在local和mapped模式下,打开异步文件打开,必须在编译时和配置时打开vod_open_file_thread_pool选项,可以通过状态页面的open_file值对比async_open_file值。
  5. 为manifest文件打开gzip压缩
    gzip_types application/vnd.apple.mpegurl video/f4m application/dash+xml text/xml

配置

配置示例

Local模式

http {
    upstream fallback {
        server fallback.kaltura.com:80;
    }

    server {
        # vod settings
        vod_mode local;                                                                # 模式设置
        vod_fallback_upstream_location /fallback;                       # 请求转发
        vod_last_modified 'Sun, 19 Nov 2000 08:52:00 GMT';      # 为直播修改最后修改时间参数
        vod_last_modified_types *;

        # vod caches
        vod_metadata_cache metadata_cache 512m;                  # 视频元数据缓存
        vod_response_cache response_cache 128m;                    # manifest index缓存

        # gzip manifests
        gzip on;                                                                             # manifest index 打开gzip压缩
        gzip_types application/vnd.apple.mpegurl;                      # 要压缩的文件类型

        # file handle caching / aio
        open_file_cache          max=1000 inactive=5m;                # nginx文件句柄缓存
        open_file_cache_valid    2m;
        open_file_cache_min_uses 1;
        open_file_cache_errors   on;
        aio on;                                                                               # 打开异步I/O

        location ^~ /fallback/ {
            internal;
            proxy_pass http://fallback/;
            proxy_set_header Host $http_host;
        }

        location /content/ {
            root /web/;
            vod hls;

            add_header Access-Control-Allow-Headers '*';
            add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range';
            add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
            add_header Access-Control-Allow-Origin '*';
            expires 100d;
        }
    }
}

Mapped模式

http {
    upstream kalapi {
        server www.kaltura.com:80;
    }

    upstream fallback {
        server fallback.kaltura.com:80;
    }

    server {
        # vod settings
        vod_mode mapped;
        vod_upstream_location /kalapi;
        vod_upstream_extra_args "pathOnly=1";
        vod_fallback_upstream_location /fallback;
        vod_last_modified 'Sun, 19 Nov 2000 08:52:00 GMT';
        vod_last_modified_types *;

        # vod caches
        vod_metadata_cache metadata_cache 512m;
        vod_response_cache response_cache 128m;
        vod_mapping_cache mapping_cache 5m;

        # gzip manifests
        gzip on;
        gzip_types application/vnd.apple.mpegurl;

        # file handle caching / aio
        open_file_cache          max=1000 inactive=5m;
        open_file_cache_valid    2m;
        open_file_cache_min_uses 1;
        open_file_cache_errors   on;
        aio on;

        location ^~ /fallback/ {
            internal;
            proxy_pass http://fallback/;
            proxy_set_header Host $http_host;
        }

        location ^~ /kalapi/ {
            internal;
            proxy_pass http://kalapi/;
            proxy_set_header Host $http_host;
        }

        location ~ ^/p/\d+/(sp/\d+/)?serveFlavor/ {
            # encrypted hls
            vod hls;
            vod_secret_key "mukkaukk$vod_filepath";
            vod_hls_encryption_method aes-128;

            add_header Access-Control-Allow-Headers '*';
            add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range';
            add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
            add_header Access-Control-Allow-Origin '*';
            expires 100d;
        }
    }
}

Remote模式

http {
    upstream kalapi {
        server www.kaltura.com:80;
    }

    server {
        # vod settings
        vod_mode remote;
        vod_upstream_location /kalapi;
        vod_last_modified 'Sun, 19 Nov 2000 08:52:00 GMT';
        vod_last_modified_types *;

        # vod caches
        vod_metadata_cache metadata_cache 512m;
        vod_response_cache response_cache 128m;

        # gzip manifests
        gzip on;
        gzip_types application/vnd.apple.mpegurl;

        location ^~ /kalapi/ {
            internal;
            proxy_pass http://kalapi/;
            proxy_set_header Host $http_host;
        }

        location ~ ^/p/\d+/(sp/\d+/)?serveFlavor/ {
            vod hls;

            add_header Access-Control-Allow-Headers '*';
            add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range';
            add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
            add_header Access-Control-Allow-Origin '*';
            expires 100d;
        }
    }
}

Nginx变量

NGINX模块变量
$vod_suburi - the current sub uri. For example, if the url is: http:////,,,,.urlset/ $vod_suburi will have the value http:///// when processing the first uri.
$vod_filepath - in local / mapped modes, the file path of current sub uri. In remote mode, has the same value as $vod_suburi.
$vod_sequence_id - contains the id of the current sequence, if no id was specified in the mapping json this variable will be the same as $vod_suburi.
$vod_clip_id - the id of the current clip, this variable has a value during these phases:
Mapping of dynamic clips to concat clips
Mapping of source clip to paths
$vod_notification_id - the id of the current notification, the value is non-empty only when referenced by vod_notification_uri
$vod_dynamic_mapping - a serialized representation of the mapping of dynamic clips to concat clips.
$vod_request_params - a serialized representation of the request params, e.g. 12-f2-v1-a1. The variable contains:
The segment index (for a segment request)
The sequence index
A selection of audio/video tracks
Note: Configuration directives that can accept variables are explicitly marked as such.

配置指令:基础

vod 分段模式

语法:vod segmenter
默认:n/a
上下文:location

segmenter:
1、none MP4文件
2、dash Dynamic Adaptive Streaming over HTTP分包
3、hds Adobe HTTP Dynamic Streaming分包
4、hls Apple HTTP Live Streaming分包
5、mss 微软Smooth Streaming分包
6、thumb 缩略图

vod_mode 模式

语法:vod_mode mode
默认:local
上下文:http, server, location

vod_status 开启监控

语法:vod_status status
默认:n/a
上下文:location

配置指令:segmentation分段

vod_segment_duration 分段时长

语法:vod_segment_duration duration
默认:10s
上下文:http, server, location

强烈建议设置为GOP的倍数,如果不是GOP的倍数且vod_align_segments_to_key_frames开启,manifest中的分段时间和实际会有明显差别,还会带来空分段。

vod_live_window_duration 直播窗口时长

语法:vod_live_window_duration duration
默认:30000
上下文:http, server, location

vod_bootstrap_segment_durations 启动分段时长

语法:vod_bootstrap_segment_durations duration
默认:none
上下文:http, server, location

启动时分段时长,设置较短启动分段用于尽早确定码率,避免全程分段短。

vod_align_segments_to_key_frames 分段由关键帧开始

语法:vod_align_segments_to_key_frames on/off
默认:off
上下文:http, server, location

开启后分段由关键帧开始,可能会导致实际分段时长与manifest中声明的时长不同,除非vod_manifest_segment_durations_mode设置为accurate。

vod_segment_count_policy 分段计数策略

语法:vod_segment_count_policy last_short/last_long/last_rounded
默认:last_short
上下文:http, server, location

假设分段设置为10秒:
last_short:一个33秒的视频会分段为10, 10, 10, 3
last_long:一个33秒的视频会分段为10, 10, 13
last_rounded:一个33秒的视频会分段为10, 10, 13,一个38秒的视频会分段为10, 10, 10, 8

vod_manifest_segment_durations_mode manifest文件分段时长准确度模式

语法:vod_manifest_segment_durations_mode estimate/accurate
默认:estimate
上下文:http, server, location

设置分段精确度模式:
estimate:估算模式,设置为10秒则manifest中显示为#EXTINF:10
accurate:精确模式, 假设帧率为29.97分段为10秒,则分段为10.01秒。如果vod_align_segment_to_key_frames设置为on,则关键帧也会被计算。

配置指令:upstream

上游服务器配置

配置指令:fallback

失败回溯配置

配置指令:性能

vod_metadata_cache 视频分段缓存

语法:vod_metadata_cache zone_name zone_size [expiration]
默认:off
上下文:http, server, location
设置视频分段缓存大小和过期时间。

vod_mapping_cache

语法:vod_mapping_cache zone_name zone_size [expiration]
默认:off
上下文:http, server, location
Configures the size and shared memory object name of the mapping cache for vod (mapped mode only).

vod_live_mapping_cache

语法:vod_live_mapping_cache zone_name zone_size [expiration]
默认:off
上下文:http, server, location
Configures the size and shared memory object name of the mapping cache for live (mapped mode only).

vod_response_cache

语法:vod_response_cache zone_name zone_size [expiration]
默认:off
上下文:http, server, location
设置视频manifests文件和非视频文件缓存。

vod_live_response_cache

语法:vod_live_response_cache zone_name zone_size [expiration]
默认:off
上下文:http, server, location
Configures the size and shared memory object name of the response cache for time changing live responses. This cache holds the following types of responses for live: DASH MPD, HLS index M3U8, HDS bootstrap, MSS manifest.

vod_initial_read_size 初始读取大小

语法:vod_initial_read_size size
默认:4K
上下文:http, server, location
设置MP4文件初始读取大小

vod_max_metadata_size 最大支持视频元数据大小

语法:vod_max_metadata_size size
默认:128MB
上下文:http, server, location
设置最大支持的视频元数据大小 (即MP4 - moov 元素大小)

vod_max_frames_size 最大帧大小

语法:vod_max_frames_size size
默认:16MB
上下文:http, server, location
Sets the limit on the total size of the frames of a single segment

vod_cache_buffer_size

语法:vod_cache_buffer_size size
默认:256K
上下文:http, server, location
Sets the size of the cache buffers used when reading MP4 frames.

vod_open_file_thread_pool

语法:vod_open_file_thread_pool pool_name
默认:off
上下文:http, server, location
Enables the use of asynchronous file open via thread pool. The thread pool must be defined with a thread_pool directive, if no pool name is specified the default pool is used. This directive is supported only on nginx 1.7.11 or newer when compiling with --add-threads. Note: this directive currently disables the use of nginx's open_file_cache by nginx-vod-module

vod_output_buffer_pool HTTP响应内存池

语法:vod_output_buffer_pool size count
默认:off
上下文:http, server, location
Pre-allocates buffers for generating response data, saving the need allocate/free the buffers on every request.

vod_performance_counters

语法:vod_performance_counters zone_name
默认:off
上下文:http, server, location
Configures the shared memory object name of the performance counters

配置指令:url结构

修改url结构

配置指令:响应头部

修改响应头部

配置指令:ad stitching (mapped mode only)

配置指令:DRM / encryption

配置指令:DASH

配置指令:HDS

配置指令:HLS

vod_hls_encryption_method

语法:vod_hls_encryption_method method
默认:none
上下文:http, server, location
Sets the encryption method of HLS segments, allowed values are: none (default), aes-128, sample-aes.

vod_hls_absolute_master_urls 设置manifest文件url相对/绝对

语法:vod_hls_absolute_master_urls on/off
默认:on
上下文:http, server, location
When enabled the server returns absolute playlist URLs in master playlist requests

vod_hls_absolute_index_urls 设置manifest文件url相对/绝对

语法:vod_hls_absolute_index_urls on/off
默认:on
上下文:http, server, location
When enabled the server returns absolute segment URLs in media playlist requests

vod_hls_absolute_iframe_urls

语法:vod_hls_absolute_iframe_urls on/off
默认:off
上下文:http, server, location
When enabled the server returns absolute segment URLs in iframe playlist requests

vod_hls_master_file_name_prefix

syntax: vod_hls_master_file_name_prefix name
default: master
context: http, server, location
The name of the HLS master playlist file (an m3u8 extension is implied).

vod_hls_index_file_name_prefix

syntax: vod_hls_index_file_name_prefix name
default: index
context: http, server, location
The name of the HLS media playlist file (an m3u8 extension is implied).

vod_hls_iframes_file_name_prefix

syntax: vod_hls_iframes_file_name_prefix name
default: iframes
context: http, server, location
The name of the HLS I-frames playlist file (an m3u8 extension is implied).

vod_hls_segment_file_name_prefix

syntax: vod_hls_segment_file_name_prefix name
default: seg
context: http, server, location
The prefix of segment file names, the actual file name is seg--v-a.ts.

vod_hls_encryption_key_file_name

syntax: vod_hls_encryption_key_file_name name
default: encryption.key
context: http, server, location
The name of the encryption key file name, only relevant when encryption method is not none.

vod_hls_encryption_key_uri

syntax: vod_hls_encryption_key_uri uri
default: a url pointing to encryption.key
context: http, server, location
Sets the value of the URI attribute of EXT-X-KEY, only relevant when encryption method is not none. The parameter value can contain variables.

vod_hls_encryption_key_format

syntax: vod_hls_encryption_key_format format
default: none
context: http, server, location
Sets the value of the KEYFORMAT attribute of EXT-X-KEY, only relevant when encryption method is not none.

vod_hls_encryption_key_format_versions

syntax: vod_hls_encryption_key_format_versions versions
default: none
context: http, server, location
Sets the value of the KEYFORMATVERSIONS attribute of EXT-X-KEY, only relevant when encryption method is not none.

vod_hls_interleave_frames 音视频交叉分包

syntax: vod_hls_interleave_frames on/off
default: off
context: http, server, location
When enabled, the HLS muxer interleaves frames of different streams (audio / video). When disabled, on every switch between audio / video the muxer flushes the MPEG TS packet.

vod_hls_align_frames 音视频帧对齐

syntax: vod_hls_align_frames on/off
default: on
context: http, server, location
When enabled, every video / audio frame is aligned to MPEG TS packet boundary, padding is added as needed.

vod_hls_output_id3_timestamps

syntax: vod_hls_output_id3_timestamps on/off
default: on
context: http, server, location
When enabled, an ID3 TEXT frame will be outputted in each TS segment, containing a JSON with the absolute segment timestamp. The timestamp is measured in milliseconds since the epoch (unixtime x 1000), the JSON structure is: {"timestamp":1459779115000}

配置指令:MSS

配置指令:缩略图截取

配置指令:misc 混合