Matroska container doesn't write h264 extdata with a pcm_s16le input
|Reported by:||Reboot||Owned by:|
|Blocking:||Reproduced by developer:||yes|
|Analyzed by developer:||no|
Summary of the bug: ffmpeg does not write the pixel format (extdata) of a h264 encoded video stream to an mkv file, depending on the length and codec of the audio source (in this particular instance pcm_s16le). This is when combining two inputs (still image video, and audio).
This bug probably also applies when encoding other pcm-included streams to different codecs.
How to reproduce:
% ffmpeg -f lavfi -i testsrc2,trim=end_frame=1 -f lavfi -i sine=d=120 -c:v libx264 -c:a pcm_s16le output.mkv ffmpeg version is N-107013-g93b31dae1d-20220527 built on 2022-05-27 12:30 - built with gcc 11.2.0 (crosstool-NG 220.127.116.113_681aaef)
(this is using the latest gpl build from BtbN at time of writing)
After encoding, reading the output file with either ffmpeg or another application results in not finding the pixel format codec parameter for the video stream. This can be problematic for web apps.
Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.
Thanks to #ffmpeg IRC members JEEB and durandai_1707 for helping me troubleshoot and reproduce this issue.