How to View Luma Distribution with FFmpeg Waveform

Analyzing the brightness and exposure of video files is crucial for accurate color grading and quality control. This article provides a quick, step-by-step guide on how to use the FFmpeg waveform filter to visualize the luma (brightness) distribution of a video, detailing the command-line syntax, parameter configurations, and how to view the scope in real-time.

The Basic Command for Luma Waveform

To isolate and view only the luma (Y) channel of a YUV video, you must configure the waveform filter’s components parameter. In YUV color space, the first channel (component 1) represents luma.

Use the following ffplay command to view the luma distribution of your video in real-time:

ffplay -vf "waveform=mode=column:components=1:display=parade" input.mp4

To render this waveform visualization directly into a new video file using ffmpeg, use this command:

ffmpeg -i input.mp4 -vf "waveform=mode=column:components=1:display=parade" output.mp4

Parameter Breakdown

Advanced: View Video and Waveform Side-by-Side

To see how the luma waveform reacts to the video in real-time, you can use the hstack (horizontal stack) filter to display the original video next to the waveform.

Because the waveform filter output matches the input video’s dimensions, you can easily stack them horizontally:

ffplay -i input.mp4 -vf "split[original][temp];[temp]waveform=mode=column:components=1:intensity=0.1[wf];[original][wf]hstack"

Additional Useful Parameters