The afade filter raises the volume gradually at the start of the audio (fade-in) or lowers it gradually at the end (fade-out). You set the type with t, the start time with st and the length with d.
Basic Commands
Fade-in (gradually ramp up at the start)
ffmpeg -i input.mp3 -af "afade=t=in:st=0:d=3" output.mp3
| Parameter | Value | Description |
|---|---|---|
t=in |
— | Fade in |
st=0 |
0 s | Fade start time |
d=3 |
3 s | Fade duration |
Fade-out (gradually ramp down at the end)
First check the length of the audio:
ffmpeg -i input.mp3 -f null /dev/null 2>&1 | grep Duration
The Duration: line shows the length.
To fade out over the last 10 seconds of a 60-second file:
ffmpeg -i input.mp3 -af "afade=t=out:st=50:d=10" output.mp3
| Parameter | Value | Description |
|---|---|---|
t=out |
— | Fade out |
st=50 |
50 s | Fade start time |
d=10 |
10 s | Fade duration |
Applying Fade-In and Fade-Out Together
Put both afade filters in -af, separated by a comma:
ffmpeg -i input.mp3 -af "afade=t=in:st=0:d=3,afade=t=out:st=50:d=10" output.mp3
Curve Types
The curve option sets how the volume changes over the fade:
ffmpeg -i input.mp3 -af "afade=t=in:st=0:d=3:curve=qsin" output.mp3
| Curve | Description |
|---|---|
tri |
Linear (triangular). The default |
qsin |
Quarter sine wave. Natural-sounding |
hsin |
Half sine wave. Smoother S-shape |
exp |
Exponential. Changes sharply |
log |
Logarithmic. Starts sharply, ends gently |
Apply Fades to the Audio Track of a Video File
ffmpeg -i input.mp4 -af "afade=t=in:st=0:d=2" -c:v copy output.mp4
-c:v copy copies the video as it is, so only the audio is re-encoded.
Combine with Video Fades
Use fade for the picture and afade for the sound:
ffmpeg -i input.mp4 -vf "fade=t=in:st=0:d=2" -af "afade=t=in:st=0:d=2" -c:a aac output.mp4
Common Pitfalls
Match st to the actual audio length for fade-out
If st + d goes past the end of the audio, FFmpeg shows no error. The audio ends before the fade is finished, so the sound cuts off before it has fully faded out. Check the length of the audio first and set st from it.
Combine with -c:v copy to re-encode only the audio
If the video needs no changes, add -c:v copy. The picture quality stays the same, and only the audio is re-encoded.
Measured: time and size
The measured command:
ffmpeg -i input.mp4 -af "afade=t=in:st=0:d=2,afade=t=out:st=115:d=5" -c:v copy -c:a aac -b:a 128k output.mp4
| Measured | |
|---|---|
| Wall time | 1.03 s (116.62x realtime) |
| Output size | 353.15 MB |
Test machine: Core i9-14900KF (32 threads), FFmpeg 8.1 (gyan.dev). Source: 1920x1080, 30 fps, 120 s, 351.4 MB of video (Big Buck Bunny, looped, CC BY 3.0) plus a 128 kb/s AAC sine-wave track, 353.29 MB in total. Measured 2026-09-05, one run at a time. The raw numbers are in the dataset.
Why it lands at one second
The reason is -c:v copy. afade changes only the audio, so the 1080p video is never decoded or encoded. FFmpeg copies it into the new file as it is. The only real work is making a new 128 kbps AAC audio track.
Other jobs on the same source and machine show the difference. Jobs that re-encode the video took from seconds to minutes: 27.97 s for a plain re-encode with no filter, 53.29 s for colour correction and 729.16 s for a conversion to VP9. Jobs that copy the video finished in about a second: 0.41 s to remap streams, 0.49 s to move the moov atom (the index of the file) and 1.03 s for this audio fade, which re-encodes only the audio. The gap is about 27x at the smallest (27.97 s against 1.03 s) and about 1,800x at the largest (729.16 s against 0.41 s).
The output (353.15 MB) is almost the same size as the input (353.29 MB) for the same reason. The video makes up nearly all of the file and is copied unchanged; only the audio is rewritten. An output of about the same size is normal here.
If you fade the video too
With a video fade, you cannot use -c:v copy. The video has to be re-encoded, which takes much longer. The 1.03 s above covers the audio fade only, not a video fade. As a guide, use the re-encoding times from the same source and machine: 27.97 s with no filter and 53.29 s with colour correction.
Work out the fade-out start from the length of the audio stream, not the length of the whole file. In a trimmed file, or in a variable-frame-rate video (one where the number of frames per second is not constant), the audio and video lengths can differ by a few hundred milliseconds. Check the audio duration with ffprobe -show_streams and set st to that length minus d. This keeps the fade from starting too late or ending in a hard cut.
Frequently Asked Questions
What is the difference between afade and acrossfade?
afade fades one audio track in or out. acrossfade overlaps two tracks and blends from one into the other (a crossfade). Use acrossfade to switch from one piece of background music to another, and afade for fades at the start and end.
How long should the fade be?
For speech, about 0.3–0.5 s in and 1–2 s out. For music, about 1–2 s in and 2–4 s out. A pop or click happens when sound starts or stops suddenly. To remove it, even a fade of a few milliseconds helps.
Can I fade only specific frequencies?
afade changes the volume of the whole sound. Putting lowpass in front of it does not help: that removes the high frequencies from the whole track, and the fade still applies to everything. To fade one frequency range only, split the audio with acrossover, fade one part, and mix the parts back together with amix.
This fades out everything above 500 Hz over 10 seconds, starting at 50 s:
ffmpeg -i input.mp3 -filter_complex "acrossover=split=500[low][high];[high]afade=t=out:st=50:d=10[hf];[low][hf]amix=inputs=2:normalize=0" output.mp3
normalize=0 stops amix from halving the volume.
Why does my fade start too early?
Check st= (the start time). If you leave it out, the fade starts at 0. To fade out at the end of the file, work out start = duration − fade_length and set st to that value.
Does afade re-encode the file?
Yes. With any audio filter, the audio track is re-encoded. The video can still be copied unchanged with -c:v copy.