How to Create a Vectorscope Video Using FFmpeg

This article provides a straightforward guide on how to use the FFmpeg vectorscope filter to visualize the color and chrominance properties of a video. You will learn the basic command syntax, the key parameters available to customize the monitor’s appearance, and how to display the vectorscope side-by-side with your original video.

Basic Vectorscope Command

To generate a video that displays only the vectorscope of your input video, use the vectorscope video filter. The simplest command to output a vectorscope video is:

ffmpeg -i input.mp4 -vf "vectorscope" output.mp4

This command takes input.mp4, applies the default vectorscope settings, and saves the resulting visualization as output.mp4.

Customizing the Vectorscope Filter

The vectorscope filter has several parameters that allow you to customize the style, intensity, and size of the scope. You can pass these parameters in a key=value format separated by colons.

Example of a Customized Command

To create a larger, high-intensity vectorscope with a solid green grid, use the following command:

ffmpeg -i input.mp4 -vf "vectorscope=m=color3:i=0.05:g=0.9:s=512" output.mp4

Viewing the Video and Vectorscope Side-by-Side

To analyze video color in real-time, it is highly useful to display the original video and the vectorscope monitor side-by-side. You can achieve this using FFmpeg’s filter_complex along with the hstack filter.

ffmpeg -i input.mp4 -filter_complex "[0:v]split=2[original][vscope_in];[vscope_in]vectorscope=m=color3:s=512[vscope_out];[original]scale=-1:512[original_scaled];[original_scaled][vscope_out]hstack" output.mp4

How this filter graph works:

  1. split=2: Duplicates the input video stream into two identical streams ([original] and [vscope_in]).
  2. vectorscope: Converts the [vscope_in] stream into a 512x512 pixel vectorscope monitor named [vscope_out].
  3. scale: Resizes the height of the [original] video to 512 pixels to match the height of the vectorscope, outputting it as [original_scaled].
  4. hstack: Horizontally stacks the scaled original video and the vectorscope video next to each other.