[FFmpeg-trac] #7681(undetermined:new): Ffmpeg segment produces corrupted segments after segment #0 when encoding h264 stream to mp4

FFmpeg trac at avcodec.org
Wed Jan 16 18:59:05 EET 2019


#7681: Ffmpeg segment produces corrupted segments after segment #0 when encoding
h264 stream to mp4
-------------------------------------+-------------------------------------
             Reporter:  pikwas       |                    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 pikwas):

 Ffmpeg is downloaded from here:

 https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20190116-51978ae-
 win64-static.zip


 Here is output for ffmpeg 4.0.2

 {{{
 C:\ffmpeg-4.0.2-win32-static\bin>ffmpeg.exe -f lavfi -i testsrc2 -c copy
 -flags
 +global_header -f stream_segment -segment_time 100 -segment_format_options
 movfl
 ags=+faststart -reset_timestamps 1 C:\test%d22.mp4
 ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
   built with gcc 7.3.1 (GCC) 20180722
   configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-
 bzlib --e
 nable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-
 libblur
 ay --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
 --enable-
 libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine
 --enab
 le-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame
 --enable-li
 bvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-
 libx265 --en
 able-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp
 --enable-
 libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa
 --enabl
 e-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf
 --enabl
 e-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec
 --enab
 le-dxva2 --enable-avisynth
   libavutil      56. 14.100 / 56. 14.100
   libavcodec     58. 18.100 / 58. 18.100
   libavformat    58. 12.100 / 58. 12.100
   libavdevice    58.  3.100 / 58.  3.100
   libavfilter     7. 16.100 /  7. 16.100
   libswscale      5.  1.100 /  5.  1.100
   libswresample   3.  1.100 /  3.  1.100
   libpostproc    55.  1.100 / 55.  1.100
 Input #0, lavfi, from 'testsrc2':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240
 [SAR 1:1
 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
 [stream_segment,ssegment @ 03867cc0] Opening 'C:\test022.mp4' for writing
 Output #0, stream_segment,ssegment, to 'C:\test%d22.mp4':
   Metadata:
     encoder         : Lavf58.12.100
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240
 [SAR 1:1
 DAR 4:3], q=2-31, 25 tbr, 12800 tbn, 25 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
 Press [q] to stop, [?] for help
 frame= 1428 fps=0.0 q=-1.0 size=N/A time=00:00:57.08 bitrate=N/A speed=
 114x
 [mp4 @ 03871ac0] Starting second pass: moving the moov atom to the
 beginning of
 the file
 [stream_segment,ssegment @ 03867cc0] Opening 'C:\test122.mp4' for writing
 frame= 2502 fps=2179 q=-1.0 size=N/A time=00:01:40.04 bitrate=N/A
 speed=87.1x
 [mp4 @ 03871ac0] Starting second pass: moving the moov atom to the
 beginning of
 the file
 frame= 2634 fps=2180 q=-1.0 Lsize=N/A time=00:01:45.32 bitrate=N/A
 speed=87.2x

 video:296325kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxin
 g overhead: unknown
 Exiting normally, received signal 2.
 }}}


 for ffmpeg 4.1 I can`t user testsrc2:



 {{{
 C:\ffmpeg-4.1-win64-static\bin>ffmpeg.exe -f lavfi -i testsrc2 -c copy
 -flags +g
 lobal_header -f stream_segment -segment_time 100 -segment_format_options
 movflag
 s=+faststart -reset_timestamps 1 C:\test%d22.mp4
 ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
   built with gcc 8.2.1 (GCC) 20181017
   configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-
 fontconfi
 g --enable-gnutls --enable-iconv --enable-libass --enable-libbluray
 --enable-lib
 freetype --enable-libmp3lame --enable-libopencore-amrnb --enable-
 libopencore-amr
 wb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-
 libsnappy --
 enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx
 --enable-l
 ibwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-
 libxml2 --
 enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-
 libvidstab --en
 able-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-
 libspeex --en
 able-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-
 ffnvcodec --e
 nable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2
 --enab
 le-avisynth
   libavutil      56. 22.100 / 56. 22.100
   libavcodec     58. 35.100 / 58. 35.100
   libavformat    58. 20.100 / 58. 20.100
   libavdevice    58.  5.100 / 58.  5.100
   libavfilter     7. 40.101 /  7. 40.101
   libswscale      5.  3.100 /  5.  3.100
   libswresample   3.  3.100 /  3.  3.100
   libpostproc    55.  3.100 / 55.  3.100
 Input #0, lavfi, from 'testsrc2':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240
 [SAR 1:1
 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
 [stream_segment,ssegment @ 0000000000455dc0] Opening 'C:\test022.mp4' for
 writin
 g
 [mp4 @ 0000000000412d80] Could not find tag for codec rawvideo in stream
 #0, cod
 ec not currently supported in container
 Could not write header for output file #0 (incorrect codec parameters ?):
 Invali
 d argument
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
     Last message repeated 1 times
 }}}

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


More information about the FFmpeg-trac mailing list