Convert Limited to Full Range 16-235 to 0-255 FFmpeg
This guide explains how to convert a video’s color range from limited (16-235) to full (0-255) using the FFmpeg command-line tool. You will learn the exact video filters and metadata flags required to expand the color levels correctly, preventing washed-out blacks or clipped whites in your final output.
When converting from limited range (often used in broadcast TV) to full range (used in PC graphics and web video), you must both scale the pixel values and correctly flag the output file’s metadata so media players decode the colors properly.
The Standard FFmpeg Command
To convert the color range, use the scale video filter
to expand the range and set the -color_range flag to
pc (which stands for PC range, 0-255).
Here is the recommended command:
ffmpeg -i input.mp4 -vf "scale=in_range=limited:out_range=full" -colorspace bt709 -color_trc bt709 -color_primaries bt709 -color_range pc -c:v libx264 -crf 18 -c:a copy output.mp4Command Breakdown
-vf "scale=in_range=limited:out_range=full": This video filter performs the actual mathematical conversion of the pixel values. It takes the limited 16-235 color values and stretches them to fill the 0-255 spectrum.-colorspace bt709 -color_trc bt709 -color_primaries bt709: These flags explicitly define the color space (typically BT.709 for HD video). This prevents color shifting during the conversion process.-color_range pc: This flags the output video container metadata as “full range” (PC). Without this flag, some media players may still read the video as limited range and apply an unnecessary second conversion, causing the video to look overly contrasty.-c:v libx264 -crf 18: Re-encodes the video using the H.264 codec at a high-quality CRF value of 18.-c:a copy: Copies the audio stream without re-encoding to save time and preserve original quality.
Quick Verification
After conversion, you can verify that the file is correctly flagged as full range by running:
ffprobe -show_streams input.mp4 2>&1 | grep color_rangeThe output should display color_range=pc.