How to Use FFmpeg afade Filter for Audio Fade In

This article provides a quick and practical guide on how to apply a smooth audio fade-in effect to your audio tracks using the FFmpeg command-line tool. You will learn the syntax of the afade filter, understand its key parameters like start time and duration, and see real-world command examples that you can copy and run immediately.

To apply a fade-in effect to an audio file in FFmpeg, you use the audio filter flag (-af) followed by the afade filter configuration. The basic syntax requires you to define the transition type, the start time, and the duration of the fade.

Here is the standard command to fade in an audio track right from the beginning:

ffmpeg -i input.mp3 -af "afade=type=in:start_time=0:duration=5" output.mp3

Understanding the Parameters

Alternative Shorthand Syntax

FFmpeg allows you to write the same command using shorthand parameter names, which makes the command shorter and quicker to type:

ffmpeg -i input.wav -af "afade=t=in:ss=0:d=3" output.wav

In this shorthand example, the audio will fade in starting at 0 seconds for a duration of 3 seconds.

Fading in at a Specific Timestamp

If you want the audio to play silently first and then fade in later in the track, change the start_time parameter. For example, to start a 4-second fade-in after 10 seconds of silence:

ffmpeg -i input.mp3 -af "afade=t=in:ss=10:d=4" output.mp3

Changing the Fade Curve (Optional)

By default, FFmpeg applies a linear fade. You can change the mathematical curve of the fade-in using the curve parameter to get different acoustic results (such as logarithmic or exponential).

ffmpeg -i input.mp3 -af "afade=t=in:ss=0:d=5:curve=log" output.mp3

Common curve options include: * tri (linear/triangular - default) * qsin (quarter sine) * log (logarithmic) * exp (exponential)