Increase Video Luma Range with FFmpeg eq Filter

This article explains how to expand and adjust the luma (luminance) range of a video using FFmpeg’s built-in eq (equalizer) filter. You will learn how to use the contrast, brightness, and gamma parameters within the eq filter to stretch your video's dynamic range, making blacks deeper and highlights brighter for a more vibrant visual output.

To increase the luma range of a video, you must manipulate the contrast and brightness levels. Increasing the contrast stretches the difference between the lightest and darkest parts of the image, effectively expanding the luma range.

The FFmpeg Command Syntax

The basic syntax for using the eq filter to adjust luma is as follows:

ffmpeg -i input.mp4 -vf "eq=contrast=1.2:brightness=-0.02:gamma=1.0" -c:a copy output.mp4

Parameter Breakdown

  • contrast: This is the primary parameter for adjusting luma range. The default value is 1.0.
    • Values greater than 1.0 (e.g., 1.1 to 1.5) increase the contrast, stretching the luma range.
    • Values less than 1.0 compress the luma range, making the image look flatter.
  • brightness: Increasing contrast can sometimes blow out highlights or over-darken shadows. Use the brightness parameter to offset this. The default is 0.0.
    • Adjust this in small increments (e.g., -0.05 to 0.05) to keep the overall exposure balanced after expanding the range.
  • gamma: This adjusts the non-linear brightness of the midtones without shifting the absolute black and white points. The default is 1.0.
    • A gamma value slightly below 1.0 (e.g., 0.9) can help retain detail in the midtones when contrast is high.

Practical Examples

Moderate Luma Expansion: To slightly boost the dynamic range of a dull video without losing detail:

ffmpeg -i input.mp4 -vf "eq=contrast=1.15:brightness=-0.01" -c:a copy output.mp4

Aggressive Luma Expansion: For videos that are highly washed out and require a significant stretch of the black and white levels:

ffmpeg -i input.mp4 -vf "eq=contrast=1.4:brightness=-0.05:gamma=0.95" -c:a copy output.mp4