• Steven Liu's avatar
    avformat/hlsenc: refine EXT-X-BYTERANGE support for segments · 1212e346
    Steven Liu authored
    refine EXT-X-BYTERANGE tag,
    the spec link:
    https://tools.ietf.org/html/draft-pantos-http-live-streaming-19#section-4.3.2.2
    the apple doc:
    https://developer.apple.com/library/ios/technotes/tn2288/_index.html#
    //apple_ref/doc/uid/DTS40012238-CH1-BYTE_RANGE_SUPPORT_FOR_SEGMENTS
    
    command line:
    ./ffmpeg -i ~/Movies/objectC/a.mp4 -c copy -f hls -hls_time 7
     -hls_list_size 0 -hls_segment_size 2500000 -t 40 output-test.m3u8
    output:
    localhost:ffmpeg liuqi$ ll *.ts ;cat output-test.m3u8
     -rw-r--r--  1 liuqi  staff  2792176  9 12 14:44 output-test0.ts
     -rw-r--r--  1 liuqi  staff  3112528  9 12 14:44 output-test3.ts
     -rw-r--r--  1 liuqi  staff  3377420  9 12 14:44 output-test6.ts
     -rw-r--r--  1 liuqi  staff  1228016  9 12 14:44 output-test7.ts
     #EXTM3U
     #EXT-X-VERSION:4
     #EXT-X-TARGETDURATION:10
     #EXT-X-MEDIA-SEQUENCE:0
     #EXTINF:9.021000,
     #EXT-X-BYTERANGE:1334988@0
     output-test0.ts
     #EXTINF:3.000000,
     #EXT-X-BYTERANGE:721356@1334988
     output-test0.ts
     #EXTINF:3.000000,
     #EXT-X-BYTERANGE:735832@2056344
     output-test0.ts
     #EXTINF:6.000000,
     #EXT-X-BYTERANGE:1645940@0
     output-test3.ts
     #EXTINF:3.000000,
     #EXT-X-BYTERANGE:715152@1645940
     output-test3.ts
     #EXTINF:3.000000,
     #EXT-X-BYTERANGE:751436@2361092
     output-test3.ts
     #EXTINF:9.000000,
     #EXT-X-BYTERANGE:3377420@0
     output-test6.ts
     #EXTINF:3.960000,
     #EXT-X-BYTERANGE:1228016@0
     output-test7.ts
     #EXT-X-ENDLIST
     localhost:ffmpeg liuqi$
    
     ticket-id: #5839
    Signed-off-by: 's avatarSteven Liu <lingjiujianke@gmail.com>
    Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    1212e346
hlsenc.c 38.9 KB