[FFmpeg-trac] #6067(avformat:open): HLS segment length not equal with what m3u8 reports, when ffmpeg restarts
FFmpeg
trac at avcodec.org
Tue Jan 10 02:16:09 EET 2017
#6067: HLS segment length not equal with what m3u8 reports, when ffmpeg restarts
------------------------------------+-------------------------------------
Reporter: pero | Owner: stevenliu
Type: defect | Status: open
Priority: normal | Component: avformat
Version: git-master | Resolution:
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+-------------------------------------
Comment (by stevenliu):
i have resent a new patch, it's ok now, please check it carefully.
{{{
localhost:hlsenc StevenLiu$ ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -c:v
copy -an -f hls -hls_time 4 -hls_flags
+delete_segments+append_list+omit_endlist -hls_list_size 0 -t 25
output_test.m3u8
ffmpeg version N-83030-g648c8dc Copyright (c) 2000-2017 the FFmpeg
developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --enable-libass --enable-opengl --enable-libx264
--enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local
--enable-libopencv --enable-libtesseract --enable-libspeex --enable-
libfreetype --enable-libfontconfig --enable-libfdk-aac
libavutil 55. 43.100 / 55. 43.100
libavcodec 57. 71.100 / 57. 71.100
libavformat 57. 62.100 / 57. 62.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 68.100 / 6. 68.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/Users/StevenLiu/Movies/objectC/facebook.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.22.102
description : This File is Created by Easy RealMedia Tools@!
Duration: 02:00:27.85, start: 0.000000, bitrate: 893 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
640x480, 797 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 87 kb/s (default)
Metadata:
handler_name : SoundHandler
Output #0, hls, to 'output_test.m3u8':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
description : This File is Created by Easy RealMedia Tools@!
encoder : Lavf57.62.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
640x480, q=2-31, 797 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[hls @ 0x7fd179001200] hls->dpp = [0.040000]
frame= 627 fps=0.0 q=-1.0 Lsize=N/A time=00:00:24.96 bitrate=N/A speed=
526x
video:2285kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
localhost:hlsenc StevenLiu$ cat output_test.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-DISCONTINUITY
#EXTINF:10.000000,
output_test0.ts
#EXTINF:10.000000,
output_test1.ts
#EXTINF:3.240000,
output_test2.ts
#EXTINF:1.840000,
output_test3.ts
localhost:hlsenc StevenLiu$ ffmpeg -i output_test0.ts -i output_test1.ts
-i output_test2.ts -i output_test3.ts
ffmpeg version N-82254-g75a1311 Copyright (c) 2000-2016 the FFmpeg
developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --enable-libass --enable-opengl --enable-libx264
--enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local
--enable-libopencv --enable-libtesseract --enable-libspeex --enable-
libfreetype --enable-libfontconfig --enable-libfdk-aac
libavutil 55. 35.100 / 55. 35.100
libavcodec 57. 66.101 / 57. 66.101
libavformat 57. 57.100 / 57. 57.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 66.100 / 6. 66.100
libswscale 4. 3.100 / 4. 3.100
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, mpegts, from 'output_test0.ts':
Duration: 00:00:10.00, start: 1.480000, bitrate: 899 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 640x480, 25 fps, 25 tbr, 90k tbn, 50 tbc
Input #1, mpegts, from 'output_test1.ts':
Duration: 00:00:10.00, start: 11.480000, bitrate: 714 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #1:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 640x480, 25 fps, 25 tbr, 90k tbn, 50 tbc
Input #2, mpegts, from 'output_test2.ts':
Duration: 00:00:03.24, start: 21.480000, bitrate: 456 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #2:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 640x480, 25 fps, 25 tbr, 90k tbn, 50 tbc
Input #3, mpegts, from 'output_test3.ts':
Duration: 00:00:01.84, start: 24.720000, bitrate: 1165 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #3:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 640x480, 25 fps, 25 tbr, 90k tbn, 50 tbc
At least one output file must be specified
localhost:hlsenc StevenLiu$ ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -c:v
copy -an -f hls -hls_time 4 -hls_flags
+delete_segments+append_list+omit_endlist -hls_list_size 0 -t 25
output_test.m3u8
ffmpeg version N-83030-g648c8dc Copyright (c) 2000-2017 the FFmpeg
developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --enable-libass --enable-opengl --enable-libx264
--enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local
--enable-libopencv --enable-libtesseract --enable-libspeex --enable-
libfreetype --enable-libfontconfig --enable-libfdk-aac
libavutil 55. 43.100 / 55. 43.100
libavcodec 57. 71.100 / 57. 71.100
libavformat 57. 62.100 / 57. 62.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 68.100 / 6. 68.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/Users/StevenLiu/Movies/objectC/facebook.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.22.102
description : This File is Created by Easy RealMedia Tools@!
Duration: 02:00:27.85, start: 0.000000, bitrate: 893 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
640x480, 797 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 87 kb/s (default)
Metadata:
handler_name : SoundHandler
Output #0, hls, to 'output_test.m3u8':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
description : This File is Created by Easy RealMedia Tools@!
encoder : Lavf57.62.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
640x480, q=2-31, 797 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[hls @ 0x7fd79f80d800] hls->dpp = [0.040000]
frame= 627 fps=0.0 q=-1.0 Lsize=N/A time=00:00:24.96 bitrate=N/A speed=
817x
video:2285kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
localhost:hlsenc StevenLiu$ cat output_test.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-DISCONTINUITY
#EXTINF:10.000000,
output_test0.ts
#EXTINF:10.000000,
output_test1.ts
#EXTINF:3.240000,
output_test2.ts
#EXTINF:1.840000,
output_test3.ts
#EXT-X-DISCONTINUITY
#EXTINF:10.000000,
output_test4.ts
#EXTINF:10.000000,
output_test5.ts
#EXTINF:3.240000,
output_test6.ts
#EXTINF:1.840000,
output_test7.ts
localhost:hlsenc StevenLiu$ ffmpeg -i output_test4.ts -i output_test5.ts
-i output_test6.ts -i output_test7.ts
ffmpeg version N-82254-g75a1311 Copyright (c) 2000-2016 the FFmpeg
developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --enable-libass --enable-opengl --enable-libx264
--enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local
--enable-libopencv --enable-libtesseract --enable-libspeex --enable-
libfreetype --enable-libfontconfig --enable-libfdk-aac
libavutil 55. 35.100 / 55. 35.100
libavcodec 57. 66.101 / 57. 66.101
libavformat 57. 57.100 / 57. 57.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 66.100 / 6. 66.100
libswscale 4. 3.100 / 4. 3.100
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, mpegts, from 'output_test4.ts':
Duration: 00:00:10.00, start: 1.480000, bitrate: 899 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 640x480, 25 fps, 25 tbr, 90k tbn, 50 tbc
Input #1, mpegts, from 'output_test5.ts':
Duration: 00:00:10.00, start: 11.480000, bitrate: 714 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #1:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 640x480, 25 fps, 25 tbr, 90k tbn, 50 tbc
Input #2, mpegts, from 'output_test6.ts':
Duration: 00:00:03.24, start: 21.480000, bitrate: 456 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #2:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 640x480, 25 fps, 25 tbr, 90k tbn, 50 tbc
Input #3, mpegts, from 'output_test7.ts':
Duration: 00:00:01.84, start: 24.720000, bitrate: 1165 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #3:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 640x480, 25 fps, 25 tbr, 90k tbn, 50 tbc
At least one output file must be specified
localhost:hlsenc StevenLiu$ ffprobe -show_frames -of xml output_test3.ts
|grep -r "pict_type=\"B\""
ffprobe version N-82254-g75a1311 Copyright (c) 2007-2016 the FFmpeg
developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --enable-libass --enable-opengl --enable-libx264
--enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local
--enable-libopencv --enable-libtesseract --enable-libspeex --enable-
libfreetype --enable-libfontconfig --enable-libfdk-aac
libavutil 55. 35.100 / 55. 35.100
libavcodec 57. 66.101 / 57. 66.101
libavformat 57. 57.100 / 57. 57.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 66.100 / 6. 66.100
libswscale 4. 3.100 / 4. 3.100
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, mpegts, from 'output_test3.ts':
Duration: 00:00:01.84, start: 24.720000, bitrate: 1165 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 640x480, 25 fps, 25 tbr, 90k tbn, 50 tbc
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2228400" pkt_pts_time="24.760000" pkt_dts="2228400"
pkt_dts_time="24.760000" best_effort_timestamp="2228400"
best_effort_timestamp_time="24.760000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="12596" pkt_size="81" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="3"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2232000" pkt_pts_time="24.800000" pkt_dts="2232000"
pkt_dts_time="24.800000" best_effort_timestamp="2232000"
best_effort_timestamp_time="24.800000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="12220" pkt_size="219" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="2"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2235600" pkt_pts_time="24.840000" pkt_dts="2235600"
pkt_dts_time="24.840000" best_effort_timestamp="2235600"
best_effort_timestamp_time="24.840000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="12784" pkt_size="37" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="4"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2242800" pkt_pts_time="24.920000" pkt_dts="2242800"
pkt_dts_time="24.920000" best_effort_timestamp="2242800"
best_effort_timestamp_time="24.920000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="13724" pkt_size="75" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="7"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2246400" pkt_pts_time="24.960000" pkt_dts="2246400"
pkt_dts_time="24.960000" best_effort_timestamp="2246400"
best_effort_timestamp_time="24.960000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="13536" pkt_size="94" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="6"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2250000" pkt_pts_time="25.000000" pkt_dts="2250000"
pkt_dts_time="25.000000" best_effort_timestamp="2250000"
best_effort_timestamp_time="25.000000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="13912" pkt_size="30" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="8"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2257200" pkt_pts_time="25.080000" pkt_dts="2257200"
pkt_dts_time="25.080000" best_effort_timestamp="2257200"
best_effort_timestamp_time="25.080000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="15040" pkt_size="90" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="11"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2260800" pkt_pts_time="25.120000" pkt_dts="2260800"
pkt_dts_time="25.120000" best_effort_timestamp="2260800"
best_effort_timestamp_time="25.120000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="14664" pkt_size="190" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="10"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2264400" pkt_pts_time="25.160000" pkt_dts="2264400"
pkt_dts_time="25.160000" best_effort_timestamp="2264400"
best_effort_timestamp_time="25.160000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="15228" pkt_size="46" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="12"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2275200" pkt_pts_time="25.280000" pkt_dts="2275200"
pkt_dts_time="25.280000" best_effort_timestamp="2275200"
best_effort_timestamp_time="25.280000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="24628" pkt_size="39" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="16"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2278800" pkt_pts_time="25.320000" pkt_dts="2278800"
pkt_dts_time="25.320000" best_effort_timestamp="2278800"
best_effort_timestamp_time="25.320000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="24440" pkt_size="100" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="15"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2289600" pkt_pts_time="25.440000" pkt_dts="2289600"
pkt_dts_time="25.440000" best_effort_timestamp="2289600"
best_effort_timestamp_time="25.440000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="36660" pkt_size="151" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="19"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2307600" pkt_pts_time="25.640000" pkt_dts="2307600"
pkt_dts_time="25.640000" best_effort_timestamp="2307600"
best_effort_timestamp_time="25.640000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="80840" pkt_size="3007" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="24"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2318400" pkt_pts_time="25.760000" pkt_dts="2318400"
pkt_dts_time="25.760000" best_effort_timestamp="2318400"
best_effort_timestamp_time="25.760000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="106408" pkt_size="4328" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="27"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2325600" pkt_pts_time="25.840000" pkt_dts="2325600"
pkt_dts_time="25.840000" best_effort_timestamp="2325600"
best_effort_timestamp_time="25.840000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="120696" pkt_size="3877" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="29"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2336400" pkt_pts_time="25.960000" pkt_dts="2336400"
pkt_dts_time="25.960000" best_effort_timestamp="2336400"
best_effort_timestamp_time="25.960000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="145888" pkt_size="3385" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="32"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
(standard input): <frame media_type="video" stream_index="0"
key_frame="0" pkt_pts="2358000" pkt_pts_time="26.200000" pkt_dts="2358000"
pkt_dts_time="26.200000" best_effort_timestamp="2358000"
best_effort_timestamp_time="26.200000" pkt_duration="3600"
pkt_duration_time="0.040000" pkt_pos="202288" pkt_size="3204" width="640"
height="480" pix_fmt="yuv420p" pict_type="B" coded_picture_number="38"
display_picture_number="0" interlaced_frame="0" top_field_first="0"
repeat_pict="0"/>
localhost:hlsenc StevenLiu$
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/6067#comment:14>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list