[FFmpeg-trac] #6776(undetermined:new): hls muxer does not include the first segment in m3u8 files when segmenting to fmp4

FFmpeg trac at avcodec.org
Tue Oct 24 23:46:30 EEST 2017


#6776: hls muxer does not include the first segment in m3u8 files when segmenting
to fmp4
-------------------------------------+-------------------------------------
             Reporter:  pickles      |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  unspecified  |  undetermined
             Keywords:               |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by pickles):

 Replying to [comment:1 cehoyos]:
 > Is specific input needed to reproduce or is the issue also reproducible
 with {{{-f lavfi -i testsrc}}}?

 It is still reproducible with {{{-f lavfi -i testsrc}}}:

 {{{
 ffmpeg -f lavfi -i testsrc -hls_segment_filename '%d.m4s'
 -hls_segment_type fmp4 -hls_fmp4_init_filename init.mp4 -f hls -t 30
 fmp4.m3u8
 ffmpeg version N-88116-gacf70639fb Copyright (c) 2000-2017 the FFmpeg
 developers
   built with Apple LLVM version 9.0.0 (clang-900.0.38)
   configuration: --prefix=/usr/local --enable-avfilter --enable-static
 --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree
 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags=
 --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libxvid
 --enable-ffplay --enable-libfdk-aac
   libavutil      56.  0.100 / 56.  0.100
   libavcodec     58.  0.100 / 58.  0.100
   libavformat    58.  0.100 / 58.  0.100
   libavdevice    58.  0.100 / 58.  0.100
   libavfilter     7.  0.100 /  7.  0.100
   libavresample   4.  0.  0 /  4.  0.  0
   libswscale      5.  0.100 /  5.  0.100
   libswresample   3.  0.100 /  3.  0.100
   libpostproc    55.  0.100 / 55.  0.100
 Input #0, lavfi, from 'testsrc':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 320x240
 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
 Press [q] to stop, [?] for help
 [libx264 @ 0x7fcdf6002a00] using SAR=1/1
 [libx264 @ 0x7fcdf6002a00] using cpu capabilities: MMX2 SSE2Fast SSSE3
 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
 [libx264 @ 0x7fcdf6002a00] profile High 4:4:4 Predictive, level 1.3, 4:4:4
 8-bit
 [libx264 @ 0x7fcdf6002a00] 264 - core 148 - H.264/MPEG-4 AVC codec -
 Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1
 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=6
 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
 [hls @ 0x7fcdf6801600] Opening 'init.mp4' for writing
 Output #0, hls, to 'fmp4.m3u8':
   Metadata:
     encoder         : Lavf58.0.100
     Stream #0:0: Video: h264 (libx264), yuv444p, 320x240 [SAR 1:1 DAR
 4:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc
     Metadata:
       encoder         : Lavc58.0.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
 [hls @ 0x7fcdf6801600] Opening '0.m4s' for writing
 [hls @ 0x7fcdf6801600] Opening 'fmp4.m3u8.tmp' for writing
 [hls @ 0x7fcdf6801600] Opening '1.m4s' for writing
 [hls @ 0x7fcdf6801600] Opening 'fmp4.m3u8.tmp' for writing
 [hls @ 0x7fcdf6801600] Opening '2.m4s' for writing80 bitrate=N/A
 speed=29.5x
 [hls @ 0x7fcdf6801600] Opening 'fmp4.m3u8.tmp' for writing
 [hls @ 0x7fcdf6801600] Opening 'fmp4.m3u8.tmp' for writing
 frame=  750 fps=0.0 q=-1.0 Lsize=N/A time=00:00:29.88 bitrate=N/A
 speed=34.3x
 video:130kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: unknown
 }}}

 The command should have created a 30 second video but it only plays the
 last 20 seconds as the first segment (0.m4s) is omitted from the m3u8
 file:

 {{{
 #EXTM3U
 #EXT-X-VERSION:7
 #EXT-X-TARGETDURATION:10
 #EXT-X-MEDIA-SEQUENCE:0
 #EXT-X-MAP:URI="init.mp4"
 #EXTINF:10.000000,
 1.m4s
 #EXTINF:10.000000,
 2.m4s
 #EXT-X-ENDLIST
 }}}

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


More information about the FFmpeg-trac mailing list