How to Use FFmpeg Limiter to Prevent Color Clipping
This article explains how to use the limiter video
filter in FFmpeg to prevent color channel clipping and keep video
signals within safe boundaries. You will learn the syntax of the filter,
understand how its parameters correspond to luma and chroma channels,
and see practical command-line examples for both broadcast-safe YUV
limits and RGB scaling.
To prevent color clipping in FFmpeg, you can use the
limiter filter. This filter clamps the pixel values of the
input video to a specified range, ensuring that bright highlights or
highly saturated colors do not exceed maximum thresholds (which causes
clipping) or dip below minimum thresholds (which causes crushing).
The Limiter Filter Syntax
The basic syntax for the limiter filter in FFmpeg
is:
-vf "limiter=min_l:max_l:min_c:max_c:channels"The parameters are defined as follows:
min_l: The minimum value for the first channel (typically Luma/Y in YUV, or Red in RGB). Default is the lowest possible value for the bit depth (e.g., 0 for 8-bit).max_l: The maximum value for the first channel. Default is the highest possible value for the bit depth (e.g., 255 for 8-bit).min_c: The minimum value for the chroma/color channels (e.g., U and V in YUV, or Green and Blue in RGB).max_c: The maximum value for the chroma/color channels.channels: A bitmask specifying which channels to filter. By default, it applies to all channels.
Practical Examples
1. Applying Broadcast-Safe Limits (8-bit YUV)
Standard definition and high-definition broadcast video often requires “limited range” YUV, where Luma (Y) is restricted to 16–235, and Chroma (U/V) is restricted to 16–240. To force these limits and prevent any out-of-bounds clipping, use this command:
ffmpeg -i input.mp4 -vf "limiter=16:235:16:240" -c:v libx264 -crf 18 output.mp42. Soft-Clipping RGB Channels to Avoid Hard Edges
If you are working in an RGB color space and want to prevent harsh digital clipping at the absolute boundaries (0 and 255), you can slightly compress the range. This example restricts all RGB channels to a safe range of 5 to 250:
ffmpeg -i input.png -vf "limiter=5:250:5:250" output.png3. Limiting 10-bit Video
If your source video is 10-bit (such as HDR or high-end camera footage), the values scale from 0 to 1023. To apply standard limited range (64–940 for Luma, 64–960 for Chroma) to a 10-bit file, adjust the parameters accordingly:
ffmpeg -i input_10bit.mkv -vf "limiter=64:940:64:960" -c:v libx265 -pix_fmt yuv420p10le output_10bit.mkv