Verify and Convert Video to 10-Bit yuv420p10le with FFmpeg
Working with high-quality video often requires verifying the current
color depth and converting files to a highly compatible 10-bit format.
This guide provides a straightforward tutorial on how to check a video’s
existing pixel format using FFprobe and how to convert it to the widely
supported yuv420p10le (10-bit YUV 4:2:0) format using
FFmpeg.
Step 1: Verify the Current Pixel Format
Before converting, you should check the existing pixel format of your video file. You can do this quickly using FFprobe, which is packaged alongside FFmpeg.
Run the following command in your terminal:
ffprobe -v error -select_streams v:0 -show_entries stream=pix_fmt -of default=noprint_wrappers=1:nokey=1 input.mp4input.mp4: Replace this with the path to your video file.- Output: The terminal will output a single line
indicating the pixel format (for example,
yuv420pfor 8-bit oryuv420p10lefor 10-bit).
Alternatively, you can view the complete stream details by running:
ffmpeg -i input.mp4Look for the line starting with Stream #0:0 (Video).
Inside the parentheses, you will see the pixel format listed (e.g.,
yuv420p or yuv422p).
Step 2: Convert the Video to yuv420p10le (10-bit)
Once you have verified the format, you can transcode the video to the
10-bit yuv420p10le pixel format.
Depending on your target codec, use one of the following commands:
Option A: Using H.265 / HEVC (Recommended for 10-bit)
HEVC has excellent native support for 10-bit color.
ffmpeg -i input.mp4 -c:v libx265 -pix_fmt yuv420p10le -c:a copy output.mp4Option B: Using H.264 / AVC (High 10 Profile)
Note that while H.264 supports 10-bit (High 10 profile),
some older hardware players may struggle to decode 10-bit H.264
videos.
ffmpeg -i input.mp4 -c:v libx264 -pix_fmt yuv420p10le -c:a copy output.mp4Explanation of the Parameters:
-i input.mp4: Specifies the path to your input video file.-c:v libx265(orlibx264): Chooses the video encoder.-pix_fmt yuv420p10le: Forces FFmpeg to output the video using the 10-bit YUV 4:2:0 planary pixel format.-c:a copy: Copies the audio stream directly without re-encoding it, which saves time and preserves original audio quality.output.mp4: The name of your newly converted 10-bit video file.