FFmpeg Color Range: TV vs PC Explained
In FFmpeg, the tv and pc color range
options dictate the numerical boundaries used to represent luminance
(brightness) and chrominance (color) in digital video. The primary
difference is that tv represents a limited color range
standard in television broadcasting, while pc represents a
full color range standard in computing and photography. Setting these
options correctly in FFmpeg filters ensures that video playback
preserves intended contrast levels without crushing shadows or washing
out blacks.
What is tv (Limited
Range)?
The tv option, also known as "limited range" or
"broadcast range," restricts the 8-bit digital values used for
video:
- Luminance (Y): 16 to 235
- Chrominance (U/V): 16 to 240
In this standard, a value of 16 represents reference black, and 235 represents reference white. The values below 16 (footroom) and above 235 (headroom) were historically reserved in broadcast standards to prevent signal clipping and accommodate analog overshoot. Most broadcast television standards, DVD/Blu-ray media, and streaming codecs (such as H.264/AVC and H.265/HEVC in typical profiles) default to limited range.
What is pc (Full
Range)?
The pc option, also referred to as "full range,"
utilizes the entire numerical spectrum available in an 8-bit
container:
- Luminance (Y): 0 to 255
- Chrominance (U/V): 0 to 255
In this mode, true black is mapped to 0, and true white is mapped to 255. This format is standard for computer monitors, RGB color spaces (such as sRGB), video game capture, and web graphics.
Key Differences
| Feature | tv (Limited Range) |
pc (Full Range) |
|---|---|---|
| 8-bit Luma Range | 16–235 | 0–255 |
| 8-bit Chroma Range | 16–240 | 0–255 |
| Primary Domain | Television, Blu-ray, Broadcast | Computer monitors, Web, Gaming |
| Headroom/Footroom | Yes (allows out-of-bounds signals) | No (hard limits at 0 and 255) |
| Standard Profiles | Rec. 601, Rec. 709, Rec. 2020 | JPEG, sRGB, PC graphics |
The Impact of Mismatching Ranges
Applying the wrong range during processing causes severe color degradation:
- Full range interpreted as Limited range: Blacks become grey (lifted to 16), and whites become dull light-grey (dropped to 235), resulting in a washed-out image with low contrast.
- Limited range interpreted as Full range: Any data below 16 or above 235 is discarded, stretching the mid-tones. This causes "crushed blacks" (loss of detail in dark areas) and "clipped whites" (loss of detail in highlights).
Using tv and
pc in FFmpeg
The values are typically applied using the scale filter
to convert between ranges or explicitly tag the stream's metadata.
Converting from PC to TV Range
To compress a full-range input (such as a screen recording) into a standard broadcast-compatible format:
ffmpeg -i input.mp4 -vf "scale=in_range=pc:out_range=tv" -c:v libx264 -color_range tv output.mp4Converting from TV to PC Range
To expand limited-range video so that it displays with full contrast in RGB-native workflows:
ffmpeg -i input.mp4 -vf "scale=in_range=tv:out_range=pc" -c:v libx264 -color_range pc output.mp4In these commands, the scale filter handles the
mathematical expansion or compression of pixel values, while the
-color_range flag writes the appropriate metadata to the
container so that media players interpret the output correctly.