[FFmpeg-trac] #6888(undetermined:new): HLS segmenter doesn't cut .m4s files at its expected duration

FFmpeg trac at avcodec.org
Sun Dec 3 22:24:34 EET 2017


#6888: HLS segmenter doesn't cut .m4s files at its expected duration
-------------------------------------+-------------------------------------
             Reporter:  beloko       |                    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 beloko):

 Tested with different segment duration values : 2 secs, 3 secs, etc.
 And the first segment duration is always the double of its expected
 duration value.

 As example, this FFMPEG command line sets a segment duration of 3 seconds
 :

 {{{
 ffmpeg.exe -i
 "http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4"
 -loglevel verbose -threads 0 -an -sn -vcodec libx264 -force_key_frames
 "expr:gte(t,n_forced*3)" -r 25 -sc_threshold 0 -f hls -hls_time 3
 -hls_list_size 99999 -start_number 1 -hls_segment_type fmp4
 -hls_fmp4_init_filename "C:\inetpub\wwwroot\fmp4_x264\init.mp4" -t 30
 "C:\inetpub\wwwroot\fmp4_x264\big_bunny.m3u8"
 }}}


 The .m3u8 playlist content is :

 {{{
 #EXTM3U
 #EXT-X-VERSION:7
 #EXT-X-TARGETDURATION:3
 #EXT-X-MEDIA-SEQUENCE:1
 #EXT-X-MAP:URI="init.mp4"
 #EXTINF:3.000000,
 big_bunny1.m4s
 #EXTINF:3.000000,
 big_bunny2.m4s
 #EXTINF:3.000000,
 big_bunny3.m4s
 #EXTINF:3.000000,
 big_bunny4.m4s
 #EXTINF:3.000000,
 big_bunny5.m4s
 #EXTINF:3.000000,
 big_bunny6.m4s
 #EXTINF:3.000000,
 big_bunny7.m4s
 #EXTINF:3.000000,
 big_bunny8.m4s
 #EXTINF:3.000000,
 big_bunny9.m4s
 #EXT-X-ENDLIST
 }}}


 (3 x 9) = 27 seconds
 miss 3 seconds to get 30 seconds as expected

 And the FFProbe inspected duration for each segment :
 . big_bunny1.m4s = 00:00:06.00
 . big_bunny2.m4s = 00:00:03.00
 . big_bunny3.m4s = 00:00:03.00
 . big_bunny4.m4s = 00:00:03.00
 . big_bunny5.m4s = 00:00:03.00
 . big_bunny6.m4s = 00:00:03.00
 . big_bunny7.m4s = 00:00:03.00
 . big_bunny8.m4s = 00:00:03.00
 . big_bunny9.m4s = 00:00:03.00

 (6 x 1) + (3 x 8) = 30 seconds
 the 3 missing seconds are located in the first .m4s segmented file.

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


More information about the FFmpeg-trac mailing list