[FFmpeg-trac] #9110(undetermined:new): Remux TS to MP4 creates an invalid file, delay_moov flag not working as requested

FFmpeg trac at avcodec.org
Fri Feb 19 23:15:23 EET 2021


#9110: Remux TS to MP4 creates an invalid file, delay_moov flag not working as
requested
-------------------------------------+-------------------------------------
             Reporter:  hunnypuppy   |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug: When trying to remuxed a TS file to MP4 ffmpeg throws
 an error `Cannot write moov atom before AC3 packets. Set the delay_moov
 flag to fix this.` and the resulting file is invalid.
 Despite setting the delay_moov flags it still throws the same error and
 the resulting file is still missing the audio track or invalid

 How to reproduce:
 {{{
 ffmpeg -y -i "Broken_MOOV.ts" -vcodec copy -acodec copy test.mp4
 ffmpeg version 4.3.2-2021-02-02-full_build-www.gyan.dev Copyright (c)
 2000-2021 the FFmpeg developers
   built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
   configuration: --enable-gpl --enable-version3 --enable-static --disable-
 w32threads --disable-autodetect --enable-fontconfig --enable-iconv
 --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-
 libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq
 --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2
 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp
 --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom
 --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r
 --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-
 libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid
 --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va
 --enable-dxva2 --enable-libmfx --enable-libcdio --enable-libgme --enable-
 libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-
 libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame
 --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-
 libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis
 --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa
 --enable-librubberband --enable-libsoxr --enable-chromaprint
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
 Input #0, mpegts, from 'Broken_MOOV.ts':
   Duration: 00:00:05.00, start: 1.400000, bitrate: 10066 kb/s
   Program 1
     Metadata:
       service_name    : CNN HD
       service_provider: CNNHD
     Stream #0:0[0x100](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
 Hz, 5.1(side), fltp, 448 kb/s
     Stream #0:1[0x101]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
 yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions,
 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
     Side data:
       cpb: bitrate max/min/avg: 15000000/0/0 buffer size: 9781248
 vbv_delay: N/A
 [mp4 @ 0000022b73c6e800] track 1: codec frame size is not set
 Output #0, mp4, to 'test.mp4':
   Metadata:
     encoder         : Lavf58.45.100
     Stream #0:0: Video: mpeg2video (Main) (mp4v / 0x7634706D), yuv420p(tv,
 top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr,
 90k tbn, 90k tbc
     Side data:
       cpb: bitrate max/min/avg: 15000000/0/0 buffer size: 9781248
 vbv_delay: N/A
     Stream #0:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side),
 fltp, 448 kb/s
 Stream mapping:
   Stream #0:1 -> #0:0 (copy)
   Stream #0:0 -> #0:1 (copy)
 Press [q] to stop, [?] for help
 [mp4 @ 0000022b73c6e800] Cannot write moov atom before AC3 packets. Set
 the delay_moov flag to fix this.
 Error writing trailer of test.mp4: Invalid argument
 frame=   96 fps=0.0 q=-1.0 Lsize=    5979kB time=00:00:04.93
 bitrate=9928.7kbits/s speed= 215x
 video:5707kB audio:270kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 0.033545%
 }}}

 With delay_moov flag:
 {{{
 ffmpeg -y -i "Broken_MOOV.ts" -vcodec copy -acodec copy -movflags
 +delay_moov test.mp4
 ffmpeg version 4.3.2-2021-02-02-full_build-www.gyan.dev Copyright (c)
 2000-2021 the FFmpeg developers
   built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
   configuration: --enable-gpl --enable-version3 --enable-static --disable-
 w32threads --disable-autodetect --enable-fontconfig --enable-iconv
 --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-
 libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq
 --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2
 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp
 --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom
 --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r
 --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-
 libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid
 --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va
 --enable-dxva2 --enable-libmfx --enable-libcdio --enable-libgme --enable-
 libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-
 libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame
 --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-
 libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis
 --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa
 --enable-librubberband --enable-libsoxr --enable-chromaprint
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
 Input #0, mpegts, from 'Broken_MOOV.ts':
   Duration: 00:00:05.00, start: 1.400000, bitrate: 10066 kb/s
   Program 1
     Metadata:
       service_name    : CNN HD
       service_provider: CNNHD
     Stream #0:0[0x100](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
 Hz, 5.1(side), fltp, 448 kb/s
     Stream #0:1[0x101]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
 yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions,
 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
     Side data:
       cpb: bitrate max/min/avg: 15000000/0/0 buffer size: 9781248
 vbv_delay: N/A
 [mp4 @ 0000020752f8ea80] track 1: codec frame size is not set
 Output #0, mp4, to 'test.mp4':
   Metadata:
     encoder         : Lavf58.45.100
     Stream #0:0: Video: mpeg2video (Main) (mp4v / 0x7634706D), yuv420p(tv,
 top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr,
 90k tbn, 90k tbc
     Side data:
       cpb: bitrate max/min/avg: 15000000/0/0 buffer size: 9781248
 vbv_delay: N/A
     Stream #0:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side),
 fltp, 448 kb/s
 Stream mapping:
   Stream #0:1 -> #0:0 (copy)
   Stream #0:0 -> #0:1 (copy)
 Press [q] to stop, [?] for help
 [mp4 @ 0000020752f8ea80] Cannot write moov atom before AC3 packets. Set
 the delay_moov flag to fix this.
     Last message repeated 5 times
 [mp4 @ 0000020752f8ea80] Cannot write moov atom before AC3 packets. Set
 the delay_moov flag to fix this.
     Last message repeated 1 times
 frame=   96 fps=0.0 q=-1.0 Lsize=       5kB time=00:00:04.93 bitrate=
 7.8kbits/s speed= 125x
 video:5707kB audio:270kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: unknown
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/9110>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list