Opened 10 months ago

Last modified 10 months ago

#10449 new defect

ffmpeg produced freezed frames in joining multiple videos

Reported by: elias tsolis Owned by:
Priority: important Component: avfilter
Version: unspecified Keywords: freeze freezing
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

ffmpeg -loglevel 99 -hwaccel_output_format vaapi  -vaapi_device /dev/dri/renderD128  -f concat -safe 0 -i "./vids.txt"   -c:v libx265  -x265-params  crf=18  -pix_fmt yuvj420p -vf "eq=brightness=0.2:contrast=0.7:saturation=1:gamma=1"    -fps_mode vfr   -fflags  +genpts  vid_output.mp4
ffmpeg version 5.1.3-1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12 (Debian 12.2.0-14)
configuration: --prefix=/usr --extra-version=1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
libavutil      57. 28.100 / 57. 28.100
libavcodec     59. 37.100 / 59. 37.100
libavformat    59. 27.100 / 59. 27.100
libavdevice    59.  7.100 / 59.  7.100
libavfilter     8. 44.100 /  8. 44.100
libswscale      6.  7.100 /  6.  7.100
libswresample   4.  7.100 /  4.  7.100
libpostproc    56.  6.100 / 56.  6.100

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

videos here for 7 days: (vid1 + vid2 = vid_output.mp4)
https://wetransfer.com/downloads/16f8b0f60d92369886c11b940f4d404520230706113434/953d45d2eb7bde0e8664630c0ae640a120230706113445/e72977?trk=TRN_TDL_01&utm_campaign=TRN_TDL_01&utm_medium=email&utm_source=sendgrid

Attachments (1)

ffmpeg_bug.txt (1.1 MB ) - added by elias tsolis 10 months ago.

Download all attachments as: .zip

Change History (4)

by elias tsolis, 10 months ago

Attachment: ffmpeg_bug.txt added

comment:1 by elias tsolis, 10 months ago

Her it is a second example with full log (available for 7 days: https://we.tl/t-0oitGnaZTa

All videos play fine in mpv / vlc /sm players

example of ffmpeg error log
-no solution has been found in forums.
-changing video container from mp4 to mkv didnt solve the problem.

Error while decoding stream #0:0: Invalid data found when processing input
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 0, sample 155, dts 5273239
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 1, sample 247, dts 5248000
[concat @ 0x55fc8cc3b200] file:1 stream:1 pts:251904 pts_time:5.248 dts:251904 dts_time:5.248 -> pts:2612256 pts_time:54.422 dts:2612256 dts_time:54.422
[h264 @ 0x55fc8d145e00] No start code is found.
[h264 @ 0x55fc8d145e00] Error splitting the input into NAL units.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 0, sample 155, dts 5273239
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 1, sample 248, dts 5269333
[concat @ 0x55fc8cc3b200] file:1 stream:1 pts:252928 pts_time:5.26933 dts:252928 dts_time:5.26933 -> pts:2613280 pts_time:54.4433 dts:2613280 dts_time:54.4433
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 0, sample 155, dts 5273239
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 1, sample 249, dts 5290667
[concat @ 0x55fc8cc3b200] file:1 stream:0 pts:60672 pts_time:5.34085 dts:59904 dts_time:5.27324 -> pts:619289 pts_time:54.5149 dts:618521 dts_time:54.4473
Error while decoding stream #0:0: Invalid data found when processing input
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 0, sample 156, dts 5307042
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 1, sample 249, dts 5290667
[concat @ 0x55fc8cc3b200] file:1 stream:1 pts:253952 pts_time:5.29067 dts:253952 dts_time:5.29067 -> pts:2614304 pts_time:54.4647 dts:2614304 dts_time:54.4647
[h264 @ 0x55fc8d15a280] No start code is found.
[h264 @ 0x55fc8d15a280] Error splitting the input into NAL units.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 0, sample 156, dts 5307042
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 1, sample 250, dts 5312000
[concat @ 0x55fc8cc3b200] file:1 stream:0 pts:60288 pts_time:5.30704 dts:60288 dts_time:5.30704 -> pts:618905 pts_time:54.4811 dts:618905 dts_time:54.4811
Error while decoding stream #0:0: Invalid data found when processing input
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 0, sample 157, dts 5340845
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fc986eae00] stream 1, sample 250, dts 5312000
[concat @ 0x55fc8cc3b200] file:1 stream:1 pts:254976 pts_time:5.312 dts:254976 dts_time:5.312 -> pts:2615328 pts_time:54.486 dts:2615328 dts_time:54.486
[h264 @ 0x55fc8d16e700] No start code is found.

comment:2 by elias tsolis, 10 months ago

I found the problem. Just rotating one of the videos only in metadata, produce these errors. Try to encode two videos - one horizontally and another vertically oriented. Same errors - freeze frames produced by ffmpeg.
So, there is a proper way to merge two videos of different orientation without rencoding two times with ffmpeg?

comment:3 by elias tsolis, 10 months ago

Also, there is the problem how can you know if one of these videos is "rotated" only in metadata beforehand?

Note: See TracTickets for help on using tickets.