Summary of the bug:
How to reproduce:
% ffmpeg -y -i bad-interleaving.mkv -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -v trace output.mp4 1>ffmpeg.stdout 2>ffmpeg.stderr
The file bad-interleaving.mkv has an interleaving problem at 18:32 where the video gets stuck bud the audio keeps playing. Video playback resumes later at 34:37. Both input and output files have the exact same issue. mplayer successfully reports this problem during playback:
% mplayer bad-interleaving.mkv
MPlayer SVN-r38359 (C) 2000-2022 MPlayer Team
226 audio & 469 video codecs
[...]
Possibly bad interleaving detected.
Use -ni option if this causes playback issues and avoid or fix the program that created the file.
[...]
Exiting... (Quit)
I think that ffmpeg.stderr at line 108031 could mention something about it, but not sure if it's warning enough:
108030# frame=26488 fps= 67 q=40.0 size= 132352kB time=00:18:39.37 bitrate= 968.6kbits/s dup=0 drop=184 speed=2.85x
108031# [mp4 @ 0x55a47535e500] Delay between the first packet and last packet in the muxing queue is 10008163 > 10000000: forcing output
Sample file and full logs:
https://mega.nz/folder/YWsxDDaT#4vA-cpnBQU32vkd9BmI3mQ