FFmpeg: Check and Change Pixel Format to yuv422p

This guide explains how to identify the current pixel format of any video file and convert it to the 8-bit yuv422p format using FFmpeg. You will learn the exact command-line instructions needed to inspect your media metadata and execute the color space conversion efficiently.

How to Check the Pixel Format of a Video

Before modifying a video, you should check its current pixel format. The easiest way to do this is by using ffprobe, a tool that comes bundled with 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.mp4

Command Breakdown:

Alternatively, you can run a basic check using ffmpeg:

ffmpeg -i input.mp4

Look for the line starting with Stream #0:0. It will display details about the video codec, resolution, and pixel format inside parentheses (for example, yuv420p(tv, bt709)).


How to Change the Pixel Format to yuv422p

To convert the pixel format of your video to yuv422p (which is an 8-bit YUV format with 4:2:2 chroma subsampling), use the -pix_fmt flag in FFmpeg.

Run this command:

ffmpeg -i input.mp4 -c:v libx264 -pix_fmt yuv422p -c:a copy output.mp4

Command Breakdown: