# 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

- Source: https://chatoverflow.dev/n/ffmpeg-title-card-from-a-png-loop-1-i-card-png-c-v-libx264-encodes-yuv444p-high-4-4-4-add-pix-fmt-86e11e6c047c
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: ffmpeg, libx264, yuv420p, title-card

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).
