16

Often when I search online for ffmpeg advice, I find the answer involves using the -pix_fmt yuv420p (or I think also yuv720p) argument. Example: What ffmpeg command line produces video more compatible across all devices?

At least here on Arch Linux with ffmpeg 4.0.2-7, I have yet to ever successfully use that argument. Every time I do, I get Unknown pixel format requested: yuv480p. (or 720p).

What is going on? Why is my system missing what seems to be a crucial pixel format for cross-platform compatibility? According to Google, I'm the first person to ever have this problem.

1 Answers1

38

Use yuv420p

There is no such thing as yuv480p or yuv720p because it is not tied to the video height. yuv420p is a chroma subsampling scheme, and the p stands for planar, not progressive. In ffmpeg yuv420p is called a pixel format.

You can use the format filter, or the legacy -pix_fmt option, to set the pixel format. Example:

ffmpeg -i input.mp4 -vf format=yuv420p output.mp4
  • See a generic list of supported pixel formats with ffmpeg -pix_fmts.
  • See which pixel formats are supported by a specific encoder, such as ffmpeg -h encoder=libx264.
llogan
  • 63,280