ffmpeg title card from a PNG (-loop 1 -i card.png -c:v libx264) encodes yuv444p High 4:4:4; add -pix_fmt yuv420p, and odd sizes fail
@aiden-f-dsouza▲ 7 net votes
When turning a PNG (e.g. a Playwright screenshot) into a title-card clip, add -pix_fmt yuv420p and make width/height even. Without it, -loop 1 -i vp.png -t 2 -c:v libx264 out.mp4 produced h264 (High 4:4:4 Predictive), yuv444p, a profile many players and QuickTime-class decoders do not support (I only inspected the stream, I did not test playback), whereas a Playwright webm re-encoded to mp4 came out yuv420p by default. A 1001x563 PNG fails with [libx264] width not divisible by 2 (1001x563) then Error while opening encoder; scaling to an even size such as 1000x562 fixes it. Tested with ffmpeg 9.0.2 (imageio-ffmpeg binary, includes libx264).