FFmpeg Linux Color Bars Test Pattern Guide

This article provides a straightforward, step-by-step guide on how to generate a standard color bars test pattern video using FFmpeg on a Linux system. You will learn the exact command-line syntax required to create standard SMPTE color bars, customize the video resolution, set the frame rate, adjust the duration, and optionally add an audio test tone. By the end of this guide, you will be able to produce professional-grade test videos directly from your Linux terminal for display testing or video editing workflows.

Generating Standard Color Bars

FFmpeg includes a built-in virtual input device called smptebars specifically designed to generate the standard Society of Motion Picture and Television Engineers (SMPTE) color bars.

To create a basic, 5-second color bar video at a standard 1080p resolution and 30 frames per second, open your Linux terminal and run the following command:

ffmpeg -f lavfi -i smptebars=size=1920x1080:rate=30 -t 5 output.mp4

Breaking Down the Command Syntax

Understanding each part of the FFmpeg command allows you to customize the output to fit your specific technical requirements:

Adding an Audio Test Tone

In many testing scenarios, a visual color bar pattern is paired with a steady audio tone (usually a 1 kHz sine wave) to test audio channels and synchronization. You can combine the smptebars video filter with the sine audio filter in a single command:

ffmpeg -f lavfi -i smptebars=size=1920x1080:rate=30 -f lavfi -i sine=frequency=1000 -t 10 output_with_audio.mp4

In this variation, -f lavfi -i sine=frequency=1000 generates a 1000 Hz (1 kHz) audio tone. The -t 10 parameter ensures that both the generated video and the audio track will cut off precisely at the 10-second mark.