Convert yuv420p10le to yuv420p with FFmpeg

This article provides a quick, step-by-step guide on how to convert a video's pixel format from 10-bit (yuv420p10le) to standard 8-bit (yuv420p) using FFmpeg. Converting to yuv420p is a common solution for resolving playback compatibility issues on older devices, web browsers, and media players that do not support high-bitrate 10-bit color spaces.

The Basic Conversion Command

To change the pixel format of a video, you need to use the -pix_fmt flag in FFmpeg. Run the following command in your terminal:

ffmpeg -i input.mp4 -pix_fmt yuv420p output.mp4

Command Breakdown

  • ffmpeg: Calls the FFmpeg program.
  • -i input.mp4: Specifies the path to your original 10-bit video file.
  • -pix_fmt yuv420p: Instructs FFmpeg to convert the pixel format to 8-bit YUV 4:2:0.
  • output.mp4: The name and format of your newly generated video file.

Because changing the pixel format requires re-encoding the video, it is best to specify a video codec and a quality target (using Constant Rate Factor, or CRF) to ensure your output video looks sharp and does not have unnecessarily large file sizes.

Use this command for standard H.264 video encoding:

ffmpeg -i input.mp4 -c:v libx264 -crf 20 -pix_fmt yuv420p -c:a copy output.mp4
  • -c:v libx264: Encodes the video using the H.264 codec, which is highly compatible with almost all devices.
  • -crf 20: Controls the video quality. Scale ranges from 0 (lossless) to 51 (worst). A value between 18 and 23 offers an excellent balance of quality and file size.
  • -c:a copy: Copies the original audio stream directly without re-encoding it, saving time and preserving audio quality.