Opened 5 months ago
Last modified 2 months ago
#10944 new defect
FFmpeg 7.0.1-full can't reencode partly broken mp4 file unless affected part is removed first
Reported by: | degradox | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | unspecified | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
The mp4 file is broken because was made like so by ffmpeg itself, the previous original file was correct. The beginning and end of the file are ok but during conversion the resulting file is broken because can't get past it.
If the affected part is removed using -ss and -to to get the first seconds and last seconds then there's no problem.
How to reproduce:
% ffmpeg -i .\middle_broken.mp4 .\out.mp4 ffmpeg version 6.1.1-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --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 58. 29.100 / 58. 29.100 libavcodec 60. 31.102 / 60. 31.102 libavformat 60. 16.100 / 60. 16.100 libavdevice 60. 3.100 / 60. 3.100 libavfilter 9. 12.100 / 9. 12.100 libswscale 7. 5.100 / 7. 5.100 libswresample 4. 12.100 / 4. 12.100 libpostproc 57. 3.100 / 57. 3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\middle_broken.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf60.16.100 Duration: 00:01:40.02, start: 0.016000, bitrate: 6043 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 6018 kb/s, 60 fps, 60 tbr, 90k tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 131 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0] Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help [libx264 @ 0000019d80770800] using SAR=1/1 [libx264 @ 0000019d80770800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0000019d80770800] profile High, level 4.2, 4:2:0, 8-bit [libx264 @ 0000019d80770800] 264 - core 164 r3172 c1c9931 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - 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=-2 threads=12 lookahead_threads=2 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 Output #0, mp4, to '.\out.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf60.16.100 Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 60 fps, 15360 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] encoder : Lavc60.31.102 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0] encoder : Lavc60.31.102 aac frame= 65 fps=0.0 q=31.0 size= 0kB time=00:00:02.06 bitrate= 0.2kbits/s dup=120 drop=0 speed=10.8x frame= 65 fps= 61 q=31.0 size= 0kB time=00:00:02.06 bitrate= 0.2kbits/s dup=120 drop=0 speed=1.93x frame= 119 fps= 75 q=31.0 size= 256kB time=00:00:02.98 bitrate= 702.3kbits/s dup=120 drop=0 speed=1.89x frame= 162 fps= 77 q=31.0 size= 256kB time=00:00:03.66 bitrate= 571.6kbits/s dup=120 drop=0 speed=1.74x frame= 206 fps= 79 q=31.0 size= 512kB time=00:00:04.43 bitrate= 945.3kbits/s dup=120 drop=0 speed=1.69x frame= 242 fps= 78 q=31.0 size= 512kB time=00:00:05.03 bitrate= 833.2kbits/s dup=120 drop=0 speed=1.61x frame= 285 fps= 79 q=31.0 size= 1024kB time=00:00:05.73 bitrate=1461.8kbits/s dup=120 drop=0 speed=1.58x frame= 329 fps= 79 q=31.0 size= 1024kB time=00:00:06.48 bitrate=1293.5kbits/s dup=120 drop=0 speed=1.56x frame= 377 fps= 81 q=31.0 size= 1280kB time=00:00:07.27 bitrate=1441.5kbits/s dup=120 drop=0 speed=1.56x [NULL @ 0000019d80786a00] Invalid NAL unit size (0 > 1086). [NULL @ 0000019d80786a00] missing picture in access unit with size 1090 [h264 @ 0000019d82ddbfc0] error while decoding MB 6 66, bytestream -13 [h264 @ 0000019d82ddbfc0] concealing 283 DC, 283 AC, 283 MV errors in P frame [aac @ 0000019d82957b80] channel element 0.0 duplicate [aist#0:1/aac @ 0000019d807d5300] Error submitting packet to decoder: Invalid data found when processing input [...] [vist#0:0/h264 @ 0000019d807d5180] Error submitting packet to decoder: Invalid data found when processing input Last message repeated 1 times [h264 @ 0000019d82e973c0] co located POCs unavailable [vist#0:0/h264 @ 0000019d807d5180] Error submitting packet to decoder: Invalid data found when processing input [h264 @ 0000019d807ee940] co located POCs unavailable [vist#0:0/h264 @ 0000019d807d5180] Error submitting packet to decoder: Invalid data found when processing input Last message repeated 2 times [vost#0:0/libx264 @ 0000019d82765cc0] More than 1000 frames duplicated frame= 5546 fps=102 q=31.0 size= 7168kB time=00:01:33.37 bitrate= 628.9kbits/s dup=5279 drop=0 speed=1.73x [vist#0:0/h264 @ 0000019d807d5180] corrupt decoded frame frame= 5583 fps=102 q=31.0 size= 7168kB time=00:01:34.05 bitrate= 624.3kbits/s dup=5279 drop=0 speed=1.72x frame= 5615 fps=102 q=31.0 size= 7424kB time=00:01:34.57 bitrate= 643.1kbits/s dup=5279 drop=0 speed=1.71x frame= 5637 fps=101 q=31.0 size= 7680kB time=00:01:34.95 bitrate= 662.6kbits/s dup=5279 drop=0 speed= 1.7x frame= 5665 fps=101 q=31.0 size= 7936kB time=00:01:35.42 bitrate= 681.3kbits/s dup=5279 drop=0 speed= 1.7x frame= 5696 fps=100 q=31.0 size= 8192kB time=00:01:35.93 bitrate= 699.5kbits/s dup=5279 drop=0 speed=1.69x frame= 5727 fps=100 q=31.0 size= 8448kB time=00:01:36.46 bitrate= 717.4kbits/s dup=5279 drop=0 speed=1.68x frame= 5754 fps=100 q=31.0 size= 8960kB time=00:01:36.89 bitrate= 757.5kbits/s dup=5279 drop=0 speed=1.68x frame= 5779 fps= 99 q=31.0 size= 9216kB time=00:01:37.32 bitrate= 775.7kbits/s dup=5279 drop=0 speed=1.67x frame= 5810 fps= 99 q=31.0 size= 9472kB time=00:01:37.85 bitrate= 793.0kbits/s dup=5279 drop=0 speed=1.66x frame= 5839 fps= 98 q=31.0 size= 9472kB time=00:01:38.32 bitrate= 789.2kbits/s dup=5279 drop=0 speed=1.66x frame= 5871 fps= 98 q=31.0 size= 9728kB time=00:01:38.85 bitrate= 806.1kbits/s dup=5279 drop=0 speed=1.65x frame= 5903 fps= 98 q=31.0 size= 9984kB time=00:01:39.39 bitrate= 822.9kbits/s dup=5279 drop=0 speed=1.65x frame= 5945 fps= 98 q=31.0 size= 10240kB time=00:01:39.92 bitrate= 839.5kbits/s dup=5280 drop=0 speed=1.64x [out#0/mp4 @ 0000019d8081e800] video:10526kB audio:225kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.774707% frame= 6001 fps= 97 q=-1.0 Lsize= 10833kB time=00:01:39.96 bitrate= 887.8kbits/s dup=5280 drop=0 speed=1.62x [libx264 @ 0000019d80770800] frame I:25 Avg QP:19.10 size:246645 [libx264 @ 0000019d80770800] frame P:1515 Avg QP:25.89 size: 2167 [libx264 @ 0000019d80770800] frame B:4461 Avg QP:33.92 size: 298 [libx264 @ 0000019d80770800] consecutive B-frames: 0.7% 0.2% 0.5% 98.5% [libx264 @ 0000019d80770800] mb I I16..4: 18.9% 31.9% 49.2% [libx264 @ 0000019d80770800] mb P I16..4: 0.5% 0.5% 0.1% P16..4: 1.4% 0.4% 0.3% 0.0% 0.0% skip:96.8% [libx264 @ 0000019d80770800] mb B I16..4: 0.3% 0.0% 0.0% B16..8: 1.0% 0.1% 0.0% direct: 0.0% skip:98.5% L0:45.7% L1:51.7% BI: 2.5% [libx264 @ 0000019d80770800] 8x8 transform intra:29.0% inter:43.7% [libx264 @ 0000019d80770800] coded y,uvDC,uvAC intra: 30.5% 25.6% 17.7% inter: 0.2% 0.2% 0.1% [libx264 @ 0000019d80770800] i16 v,h,dc,p: 9% 89% 1% 1% [libx264 @ 0000019d80770800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 44% 18% 17% 3% 3% 3% 3% 4% 5% [libx264 @ 0000019d80770800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 24% 10% 5% 5% 6% 6% 5% 6% [libx264 @ 0000019d80770800] i8c dc,h,v,p: 37% 51% 11% 2% [libx264 @ 0000019d80770800] Weighted P-Frames: Y:0.0% UV:0.0% [libx264 @ 0000019d80770800] ref P L0: 69.5% 8.5% 13.6% 8.4% [libx264 @ 0000019d80770800] ref B L0: 73.3% 23.9% 2.8% [libx264 @ 0000019d80770800] ref B L1: 96.3% 3.7% [libx264 @ 0000019d80770800] kb/s:862.06 [aac @ 0000019d82919a80] Qavg: 508.062
Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.
Attachments (1)
Change History (4)
by , 5 months ago
Attachment: | ffmpeg.log.zip added |
---|
comment:1 by , 5 months ago
Test file causing the issue:
File size is about 72MB, mirror here, sha1 is e4a9cb3e8dd608217e5697deb17b5ad38939b131
:
https://mega.nz/file/4W4CwTia#TE-uFAoRij_R7o8ykHeXEop8URIoLHkRzxZhp5zApSU
comment:3 by , 2 months ago
Summary: | FFmpeg 6.1.1-full can't reencode partly broken mp4 file unless affected part is removed → FFmpeg 7.0.1-full can't reencode partly broken mp4 file unless affected part is removed first |
---|
Full conversion log