Tool

pix_fmt Decoder: What Separates yuv420p, 422p and 444p

A name like yuv420p10le in ffprobe output or an ffmpeg command packs three things into one word: how much the color was reduced, how many bits each sample takes, and in what order the data is stored. Enter a name and the tool spells it out, then calculates the raw size before compression from resolution, fps and length. All calculations happen inside this browser and nothing is sent to a server.

Decode a pix_fmt name

yuv420p

Color model
YUV
Chroma
4:2:0 — chroma (U·V) is 1/2 horizontally and 1/2 vertically
Bit depth
8-bit per sample
Storage layout
Planar: Y, U and V (and A, if present) are stored in separate planes
Range
The name alone doesn't say. Check the file's color_range tag for limited (TV) or full (PC) range.

Among 16 pixels (4×4), there are only 4 places carrying color information. Pixels with the same number share one chroma value. Luma (Y) is stored separately for all 16.

Size before compression (raw): calculated by arithmetic

One frame
3.11 MB
One second
93.31 MB (746 Mbps)
Whole 60 sec
5.60 GB
Samples per pixel
1.50 · average 12.0 bits/pixel (signal only)

This is a theoretical value from width × height × fps × length (1 GB = 1 billion bytes), not the size of a saved file. Bit depths above 8 are calculated as held in 16-bit slots. The size after compressing with x264 or x265 differs from this value, and this site has not measured compressed size by chroma format.

Changing only the chroma at the same resolution and fps (raw size comparison)

pix_fmtOne second60 secvs. 420
yuv420p93.31 MB5.60 GB×1.00
yuv422p124 MB7.46 GB×1.33
yuv444p187 MB11.20 GB×2.00
yuv420p10le187 MB11.20 GB×1.00
yuv422p10le249 MB14.93 GB×1.33
yuv444p10le373 MB22.39 GB×2.00

“vs. 420” is the ratio with 4:2:0 at the same bit depth as 1. 10-bit is held in a 16-bit slot, so it is calculated as twice 8-bit, but that is before compression. For the difference in bit depth after compression, see the 10-bit vs. 8-bit measurements.

Does this browser accept the profile?

This is the result of asking canPlayType about each codec string. The answer is per profile, so it does not tell you whether an actual file plays at that chroma format and bit depth, or whether it is handled in hardware.

ProfileAnswer
H.264 High (4:2:0 8bit)…
H.264 High 10 (10bit)…
H.264 High 4:2:2…
H.264 High 4:4:4 Predictive…
HEVC Main (4:2:0 8bit)…
HEVC Main 10…
HEVC Range Extensions (4:2:2·4:4:4 etc.)…
VP9 Profile 0 (4:2:0)…
VP9 Profile 1 (4:2:2·4:4:4)…
AV1 Main (4:2:0)…
AV1 High (4:4:4)…

ffmpeg command to encode to the pix_fmt you want

ffmpeg -i input.mp4 -c:v libx264 -crf 20 -preset slow -pix_fmt yuv420p -c:a copy output.mp4

To check the result:

ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,profile,pix_fmt,color_range -of default=nw=1 output.mp4

The CRF value is a starting point, not a guarantee of quality.

How to read a pix_fmt name

Read yuv420p10le in pieces: yuv (a luma + chroma model), 420 (chroma subsampling), p (planar, each component stored separately), 10 (10 bits per sample) and le (little endian).nv12 is a 4:2:0 8-bit layout that stores U and V alternating in a single plane, and p010le is its 10-bit version. gbrp stores RGB as planes, so it does not reduce color. If a name has no bit count, it is 8-bit.

What separates 4:2:0, 4:2:2 and 4:4:4

The eye is sensitive to changes in brightness and less sensitive to changes in color, so the format keeps luma (Y) for every pixel and lowers only the resolution of the chroma (U·V). 4:4:4 reduces nothing, 4:2:2 halves the chroma horizontally, and 4:2:0 halves it both horizontally and vertically. At the same 8 bits, a pixel takes 1.5 samples in 4:2:0, 2 in 4:2:2 and 3 in 4:4:4, so the raw sizes come out at 1 : 1.33 : 2 (the arithmetic values in the table above). The principle is covered in more detail in Chroma subsampling in the course.

When chroma is reduced, brightness edges stay sharp but color edges can bleed. Places where only the color changes abruptly, such as red text on a black background, thin colored lines and the edges of subtitles, show it first. Natural footage has smoothly changing color, so it tends to show less. This is why people look for 4:4:4 in screen recordings, graphics and document videos. However, how visible the difference is and how much the file size grows after compression were not measured on this site.

Why add -pix_fmt yuv420p

ffmpeg passes the input format to the encoder as is whenever it can. If you feed x264 a screen recording stored as RGB, a PNG sequence, or a source shot in 4:4:4 or 4:2:2, it may be encoded with a non-4:2:0 profile (High 4:4:4 Predictive and the like). Such files are known not to open on some devices, browsers and TVs that reliably play only 4:2:0 8-bit. If compatibility is the goal, pin the format with -pix_fmt yuv420p. Conversely, 4:2:2 and 4:4:4 make sense if you are keeping an intermediate file for editing or a screen recording where color edges matter. The command box in the tool above generates the command for both cases.

How to judge playback compatibility

  • 4:2:0 8-bit: The most widely used format, known to play on most devices and browsers.
  • 4:2:0 10-bit: HDR video uses this format, so it is common on recent devices, but older devices may not decode it in hardware. You can see this browser's status in the codec support checker.
  • 4:2:2 and 4:4:4: These are broadcast, editing and screen recording formats, and support in ordinary players is known to vary by device. The “does this browser accept the profile” table above answers for the browser you are using now, but this site did not test iPhones or TVs. Open the file on the device you will send it to.

To see what format a file is in, use the video file info inspector or ffprobe. To find out whether a file fails to play because of its profile or 10-bit, continue with the playability checker.

How to use it

  1. Enter the pix_fmt= value from ffprobe in the box above to see its chroma format and bit depth.
  2. Enter the frame size, fps and length to see the size before compression. The point is to get a feel for how much the raw data grows when you switch to 4:4:4 or 10-bit.
  3. If the destination is ordinary devices or the web, set the target to yuv420p; for editing or archiving, choose the same format as the source, then copy the command.
  4. After encoding, use the ffprobe command for checking the result to see that pix_fmt is the value you intended.

Limits worth knowing

  • Size and quality after compression were not measured. The sizes in the table are values before compression, calculated as width × height × samples × fps × length. This site has no data on the size or VMAF difference when compressing 4:2:0, 4:2:2 and 4:4:4 with x264 or x265, so no numbers are given.
  • The compatibility notes are commonly known generalities. Only the browser column was asked of this device directly; iPhones, TVs and per-device support were not tested. Even the browser column is only an answer about a profile string and does not guarantee that an actual file plays.
  • The decoder knows only commonly used formats. Names not on the list (floating point, compressed textures and so on) are not interpreted, and you can see the full list with ffmpeg -pix_fmts. The bit depths and slot sizes are this site's summary of the naming rules and were not checked one by one against actual ffmpeg output.
  • Color conversion quality is not covered. The color matrix used when converting RGB to YUV (BT.601, 709) and range conversion issues are outside the scope of this tool.
  • The compression cost of 10-bit is covered in the 10-bit vs. 8-bit measurements.