[FFmpeg-trac] #3724(undetermined:new): Computed HLS duration is incorrect (deviates by ~700ms per minute)
FFmpeg
trac at avcodec.org
Tue Jun 17 18:19:38 CEST 2014
#3724: Computed HLS duration is incorrect (deviates by ~700ms per minute)
-------------------------------------+-------------------------------------
Reporter: fthiery | Type: defect
Status: new | Priority: normal
Component: | Version: git-
undetermined | master
Keywords: hls | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
When segmenting an mp4/H.264/AAC file, computed HLS playlist duration (by
summing all EXTINF metadata) deviates from the proper duration, i.e. the
original file's.
How to reproduce:
{{{
% ffmpeg -i video.mp4 -flags -global_header -f segment -segment_time 1
-segment_list playlist.m3u8 -segment_list_type m3u8 -segment_format mpegts
-map 0 -bsf h264_mp4toannexb -vcodec copy -acodec copy -y media%05d.ts
Ffmpeg version compiled from git today:
ffmpeg version N-64012-g61df081 Copyright (c) 2000-2014 the FFmpeg
developers
built on Jun 17 2014 08:50:14 with gcc 4.8 (Ubuntu
4.8.1-2ubuntu1~10.04.1)
configuration: --disable-ffserver --enable-shared --enable-libx264
--enable-libfaac --enable-libtheora --enable-libvorbis --enable-libmp3lame
--enable-libxvid --enable-gpl --enable-nonfree --enable-pthreads --enable-
libvpx --extra-cflags='-I/tmp/codecs/include/ -I/tmp/codecs/include/ao
-I/tmp/codecs/include/lame -I/tmp/codecs/include/ogg
-I/tmp/codecs/include/vorbis -I/tmp/codecs/include/theora
-I/tmp/codecs/include/vpx' --extra-ldflags='-L/tmp/codecs/lib -static'
libavutil 52. 89.100 / 52. 89.100
libavcodec 55. 67.100 / 55. 67.100
libavformat 55. 43.100 / 55. 43.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 8.100 / 4. 8.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
}}}
ffprobe reports some duration on the m3u8 resource (in my case,
1957.493063s) where the actual duration is 1935.033333s (obtained by
ffprob'ing the original mp4 file or using the last frame timestamp + frame
duration by analyzing the m3u8 resource with ffprobe). One of the issues
is that the duration difference is large enough (~40s for one hour of
content) for most players to seek to an unappropriate location (e.g. 10
seconds too late).
Btw original mp4 file has an average gop size of 30 (video is 30 fps), and
the goal here is to have 1 second segments for precise seeking.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/3724>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list