Generate Test Tones with FFmpeg Sine Filter

This article explains how to use the sine audio source filter in FFmpeg to generate audio test tones. You will learn the basic command structure, how to customize the frequency and duration of the tone, and how to output the result into a standard audio file.

Basic Usage

To generate a simple sine wave test tone, you must use FFmpeg’s Libavfilter virtual input device (-f lavfi) and specify the sine filter as the input.

The following command generates a 1000 Hz tone that lasts for 5 seconds and saves it as a WAV file:

ffmpeg -f lavfi -i "sine=frequency=1000:duration=5" output.wav

Key Parameters of the Sine Filter

The sine filter accepts several parameters to customize the audio output. The most commonly used parameters include:

Practical Examples

Generating a Standard 440 Hz Reference Tone

To generate a standard 440 Hz reference tone for 10 seconds, use the shorthand notation for the parameters:

ffmpeg -f lavfi -i "sine=f=440:d=10" reference_440.wav

Generating an Intermittent Beep

You can create a pulsing beep by using the beep_factor parameter. This example creates an 800 Hz tone that beeps once per second for a total of 5 seconds:

ffmpeg -f lavfi -i "sine=f=800:b=1:d=5" intermittent_beep.wav

Adjusting the Tone Volume

By default, the sine filter generates audio at maximum digital volume (0 dBFS), which can be very loud. To lower the volume, chain the volume filter to the output:

ffmpeg -f lavfi -i "sine=f=1000:d=5,volume=0.5" quiet_tone.wav

In this command, volume=0.5 reduces the output amplitude by 50%.