[FFmpeg-trac] #3724(undetermined:new): Computed HLS duration is incorrect with short segment durations

FFmpeg trac at avcodec.org
Fri Jun 20 17:37:34 CEST 2014


#3724: Computed HLS duration is incorrect with short segment durations
-------------------------------------+-------------------------------------
             Reporter:  fthiery      |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  git-master   |  undetermined
             Keywords:  hls          |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by fthiery):

 Here it is:

 {{{
 wget http://d2hqzi4c71e9y2.cloudfront.net/moodlemoot/presentation-des-
 defis_83f8/presentation-des-defis_low.mp4

 ffprobe presentation-des-defis_low.mp4

 ffprobe version N-60597-g1e5cb42 Copyright (c) 2007-2014 the FFmpeg
 developers
   built on Feb 14 2014 10:22:18 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. 63.101 / 52. 63.101
   libavcodec     55. 52.101 / 55. 52.101
   libavformat    55. 32.101 / 55. 32.101
   libavdevice    55.  9.101 / 55.  9.101
   libavfilter     4.  1.102 /  4.  1.102
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
   libpostproc    52.  3.100 / 52.  3.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'presentation-des-defis_low.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: mp42mp41isomiso2
     creation_time   : 2014-06-17 20:14:44
   Duration: 00:05:11.96, start: 0.000000, bitrate: 769 kb/s
     Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo,
 fltp, 96 kb/s (default)
     Metadata:
       creation_time   : 2014-06-17 20:14:44
       handler_name    : SoundHandler
     Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
 640x360 [SAR 1:1 DAR 16:9], 669 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
 (default)
     Metadata:
       creation_time   : 2014-06-17 20:14:44
       handler_name    : VideoHandler

 mkdir ts

 ffmpeg -i presentation-des-defis_low.mp4 -flags -global_header -f segment
 -segment_time 1 -segment_list ts/playlist.m3u8 -segment_list_type m3u8
 -segment_format mpegts -map 0 -bsf h264_mp4toannexb -vcodec copy -acodec
 copy -y ts/media%05d.ts

 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
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'presentation-des-defis_low.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: mp42mp41isomiso2
     creation_time   : 2014-06-17 20:14:44
   Duration: 00:05:11.96, start: 0.000000, bitrate: 769 kb/s
     Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo,
 fltp, 96 kb/s (default)
     Metadata:
       creation_time   : 2014-06-17 20:14:44
       handler_name    : SoundHandler
     Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
 640x360 [SAR 1:1 DAR 16:9], 669 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
 (default)
     Metadata:
       creation_time   : 2014-06-17 20:14:44
       handler_name    : VideoHandler
 [segment @ 0xa0deac0] Codec for stream 0 does not use global headers but
 container format requires global headers
 [segment @ 0xa0deac0] Codec for stream 1 does not use global headers but
 container format requires global headers
 Output #0, segment, to 'ts/media%05d.ts':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: mp42mp41isomiso2
     encoder         : Lavf55.43.100
     Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 96
 kb/s (default)
     Metadata:
       creation_time   : 2014-06-17 20:14:44
       handler_name    : SoundHandler
     Stream #0:1(eng): Video: h264 (avc1 / 0x31637661), yuv420p, 640x360
 [SAR 1:1 DAR 16:9], q=2-31, 669 kb/s, 25 fps, 90k tbn, 25 tbc (default)
     Metadata:
       creation_time   : 2014-06-17 20:14:44
       handler_name    : VideoHandler
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (copy)
 Press [q] to stop, [?] for help
 frame= 7799 fps=6601 q=-1.0 Lsize=N/A time=00:05:11.96 bitrate=N/A
 video:25496kB audio:3655kB subtitle:0kB other streams:0kB global
 headers:0kB muxing overhead: unknown

 ffprobe ts/playlist.m3u

 ffprobe version N-60597-g1e5cb42 Copyright (c) 2007-2014 the FFmpeg
 developers
   built on Feb 14 2014 10:22:18 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. 63.101 / 52. 63.101
   libavcodec     55. 52.101 / 55. 52.101
   libavformat    55. 32.101 / 55. 32.101
   libavdevice    55.  9.101 / 55.  9.101
   libavfilter     4.  1.102 /  4.  1.102
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
   libpostproc    52.  3.100 / 52.  3.100
 Input #0, hls,applehttp, from 'ts/playlist.m3u8':
   Duration: 00:05:15.51, start: 0.000000, bitrate: 0 kb/s
   Program 0
     Metadata:
       variant_bitrate : 0
     Stream #0:0: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz, stereo,
 fltp, 137 kb/s
     Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p,
 640x360 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
 }}}

 As you can see, duration of original video is 00:05:11.96, where the HLS
 segmented version is 00:05:15.51, a 4 seconds difference (around 13ms per
 second of added duration)

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3724#comment:7>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list