-
-
Save happyj2me/5c59110d1aa9ce6ddbed94948cb9a967 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.当以下编码参数更改时file format/number and type of tracks/encoding parameters/encoding sequence/timestamp sequence, | |
需要在m3u8中加入#EXT-X-DISCONTINUITY隔离开,让播放器重新初始化。 | |
规范: | |
https://tools.ietf.org/html/draft-pantos-http-live-streaming-13#section-3.4.11 | |
2.应用场景: | |
1)轮播不用的影片。 | |
2)插入广告 | |
3.例子: | |
http://stackoverflow.com/questions/13088123/http-live-streaming-ext-x-discontinuity-tag-makes-all-segments-afterwards-only | |
#EXTM3U | |
#EXT-X-TARGETDURATION:10 | |
#EXT-X-MEDIA-SEQUENCE:0 | |
#EXTINF:10, | |
400-clipA-0.ts | |
#EXTINF:10, | |
400-clipA-1.ts | |
#EXTINF:5, | |
400-clipA-2.ts | |
#EXT-X-DISCONTINUITY | |
#EXTINF:10, | |
400-advert0.ts | |
#EXTINF:3, | |
400-advert1.ts | |
#EXT-X-DISCONTINUITY | |
#EXTINF:10, | |
400-clipB-0.ts | |
#EXTINF:10, | |
400-clipB-1.ts | |
#EXTINF:5, | |
400-clipB-2.ts | |
#EXT-X-ENDLIST | |
#EXT-X-TARGETDURATION | |
定义每个TS的最大的duration。 | |
#EXT-X-MEDIA-SEQUENCE | |
定义当前m3u8文件中第一个文件的序列号,每个ts文件在m3u8文件中都有固定唯一的序列号,该序列号用于在MBR时切换码率进行对齐。 | |
#EXT-X-KEY | |
定义加密方式和key文件的url,用于取得16bytes的key文件解码ts文件。 | |
属性: | |
METHOD | |
URL | |
#EXT-X-PROGRAM-DATE-TIME | |
第一个文件的绝对时间 | |
#EXT-X-ALLOW-CACHE | |
是否允许cache。 | |
#EXT-X-ENDLIST | |
表明m3u8文件的结束。live m3u8没有该tag。 | |
#EXT-X-STREAM-INF | |
属性: | |
BANDWIDTH 指定码率 | |
PROGRAM-ID 唯一ID | |
CODECS 指定流的编码类型 | |
#EXT-X-DISCONTINUITY | |
当遇到该tag的时候说明以下属性发生了变化: | |
file format | |
number and type of tracks | |
encoding parameters | |
encoding sequence | |
timestamp sequence | |
#EXT-X-VERSION 该属性用不用都可以,可以没有 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment