C.W.K.
Stream
Lesson 06 of 10 · published

Audio Fades

~8 min · fade, afade, intro, outro

Level 0Viewer
0 XP0/73 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

Fade in, fade out, crossfade

Three patterns cover ~all real fade work:

  • afade=t=in:st=0:d=2 — fade in from silence over 2 seconds starting at 0.
  • afade=t=out:st=58:d=2 — fade out over 2 seconds starting at second 58 (60-second clip).
  • acrossfade=d=2 — crossfade between two inputs (lesson 8 mixing).

Curve choices

Linear (tri, default) is fine. Exponential curves (exp) sound smoother for music. Equal-power curves (esin, hsin) are the right choice for crossfades — they keep loudness perceptually constant through the overlap.

Code

Fade in/out·bash
# 2s fade-in at start, 2s fade-out at end
DURATION=$(ffprobe -v error -show_entries format=duration \
  -of default=noprint_wrappers=1:nokey=1 in.mp4)
FADE_OUT_START=$(awk -v d="$DURATION" 'BEGIN { print d - 2 }')

ffmpeg -i in.mp4 \
  -af "afade=t=in:st=0:d=2,afade=t=out:st=${FADE_OUT_START}:d=2" \
  -c:v copy out.mp4
Curves and crossfade·bash
# Exponential fade-out (sounds smoother for music)
ffmpeg -i music.wav -af "afade=t=out:st=180:d=4:curve=exp" out.wav

# Crossfade two clips with equal-power curves
ffmpeg -i intro.wav -i body.wav \
  -filter_complex "[0:a][1:a]acrossfade=d=3:c1=esin:c2=esin" \
  joined.wav

External links

Exercise

Take a 60-second music clip. Apply a 3-second linear fade-in at start and a 4-second exponential fade-out ending at the very last frame. Verify by listening on headphones. Then crossfade two clips with acrossfade=d=3:c1=esin:c2=esin and confirm the overlap doesn't create a 6 dB dip in the middle.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.