Alex Balgavy

Just some stuff about me.

Here's my dotfiles repository.

Check out my blog.

My keys: PGP, SSH

My crypto wallets (BTC, XMR)

ffmpeg how to add an echo to an audio track

Written by John Riselvato - original link

Adding an echo (or reflected sound) to an audio track is a great way to add more ambience or smoothness to a choppy playback. It’s a personal desired effect but for how simple it is to use, it’s a nice filter to have in the back pocket.

Here aecho uses gain, delays and decays make for a great airy echo effect that fades over time:

  $ ffmpeg -i input.mp3 -af "aecho=in_gain=0.5:out_gain=0.5:delays=500:decays=0.2" output.mp3

In this filter the delay and decay arguments are plural because multiple delays and decays may be stacked using the | syntax for extra echo control, as seen below:

  $ ffmpeg -i input.mp3 -af "aecho=in_gain=0.5:out_gain=0.5:delays=500|200:decays=0.2|1.0" output.mp3

Tip: The number of delays and decays must equal the same amount so if there are 2 delay numbers, there has to be 2 decay numbers.

aecho
    Indicates the name of the echo filter

in_gain
    Indicates the input gain reflected signal (default 0.6)

out_gain
    Indicates the output reflected signal (default 0.3)

delays
    Indicates the a list of time intervals (in milliseconds) between the original signal and reflections (0.0 to 90000.0 with default 0.5)

decays
    Indicates the list of loudness of each reflected signal (0.0 to 1.0 with default 0.5)

Tip: If this filter is applied to video input, a pixel format may be required, -pix_fmt yuv420p.