How to Crossfade Audio in FFmpeg with acrossfade

This guide explains how to seamlessly blend two overlapping audio tracks using the acrossfade filter in FFmpeg. You will learn the exact command syntax, how to control the transition duration, and how to apply different fade curves to achieve a professional-sounding audio transition.

The acrossfade filter in FFmpeg is designed specifically to crossfade two input audio streams. It overlays the end of the first stream with the beginning of the second stream, fading the first one out while fading the second one in.

The Basic Command

To crossfade two audio files, use the following basic command structure:

ffmpeg -i input1.mp3 -i input2.mp3 -filter_complex "acrossfade=d=5:c1=tri:c2=tri" output.mp3

Parameter Breakdown

Choosing Transition Curves

You can customize how the volume changes during the transition by changing the curve parameters (c1 and c2). Some of the most common curve options include:

For a smoother, more musical transition, a quarter-sine curve is often preferred:

ffmpeg -i input1.mp3 -i input2.mp3 -filter_complex "acrossfade=d=8:c1=qsin:c2=qsin" output.mp3

This command will create an 8-second overlap with an acoustic-style logarithmic volume curve.