Force FFmpeg Input Video to Full Color Range
By default, FFmpeg often assumes incoming YUV video files use limited color range (16–235 for 8-bit luma) unless metadata explicitly specifies otherwise. When an input video is recorded in full color range (0–255) without the proper container flags, FFmpeg can process it incorrectly, resulting in crushed blacks, blown-out highlights, or washed-out colors. This guide explains how to explicitly force FFmpeg to interpret an input video as full color range and properly preserve or convert those color levels during processing.
The Standard
Method: Using the setparams Filter
The most reliable way to override input color properties in modern
FFmpeg builds is via the setparams video filter. This
filter changes the internal frame metadata before any downstream
processing (like scaling or encoding) occurs.
To force FFmpeg to treat the input as full range (PC levels):
ffmpeg -i input.mp4 -vf "setparams=range=pc" -c:v libx264 -color_range pc output.mp4-vf "setparams=range=pc": Instructs the filter graph to treat all incoming frames as full color range (pc). You can also usefullinstead ofpc.-color_range pc: Writes the full-range flag into the output video's bitstream/container so players know to decode it as full range.
Converting Full Range Input to Limited Range Output
If your input is full range, but you want your output encoded as
standard broadcast limited range (TV levels), combine
setparams with the scale filter:
ffmpeg -i input.mp4 -vf "setparams=range=pc,scale=in_range=pc:out_range=tv" -c:v libx264 -color_range tv output.mp4In this pipeline:
setparams=range=pccorrects the misinterpreted input metadata.scale=in_range=pc:out_range=tvmaps the 0–255 range to standard 16–235 values without clipping.-color_range tvtags the final output container as limited range.
Alternative Method:
The scale Filter Alone
If your FFmpeg build does not support setparams, you can
force the input range directly inside the scale filter:
ffmpeg -i input.mp4 -vf "scale=in_range=pc:out_range=pc" -c:v libx264 -color_range pc output.mp4This ensures the scaling engine recognizes the source video as 0–255 levels and outputs 0–255 levels accordingly.
Verifying the Color Range with FFprobe
To check whether FFmpeg or media players detect the color range
correctly before and after conversion, inspect the file with
ffprobe:
ffprobe -v error -select_streams v:0 -show_entries stream=color_range input.mp4- A full-range file will return
color_range=pc. - A limited-range file will return
color_range=tv.