How to Fade In Audio with FFmpeg

Applying a fade-in effect to the beginning of an audio track prevents abrupt starts and creates a smoother listening experience. This article explains how to use FFmpeg’s afade filter to easily apply a fade-in effect, detailing the exact command-line syntax and parameter adjustments needed to control the start time and duration of the fade.

To apply a fade-in effect, you will use the FFmpeg audio filter option (-af) combined with the afade filter.

The Basic Command

Run the following command in your terminal to apply a 5-second fade-in to the start of an audio file:

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

Parameter Breakdown

Customizing the Fade

You can easily adjust the parameters to fit your specific audio requirements. For instance, if you want a shorter, 3-second fade-in that begins 2 seconds after the track starts, use this command:

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

This command-line approach is highly efficient, allowing you to modify your audio files quickly without the need for a heavy graphical user interface.