>FFmpegLab Start free
FFmpeg Guide

How to fade video & audio in and out with FFmpeg

Open from black, end on black, and ramp the soundtrack up and down — using the fade filter for video and afade for audio.

A fade is just an opacity (or volume) ramp over a time window. FFmpeg gives you fade for picture and afade for sound. Each takes a type (in or out), a start time, and a duration.

Key takeaways

Fade the video in from black

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i in.mp4 -vf "fade=t=in:st=0:d=2" -c:a copy out.mp4

st is the start time and d the duration, both in seconds.

Fade the video out to black

A fade-out starts late, so you need the clip length. If the video is 30s and you want a 3s fade, start at 27:

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i in.mp4 -vf "fade=t=out:st=27:d=3" -c:a copy out.mp4

Fade in and out together

Chain two fade filters with a comma — one in at the head, one out at the tail:

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i in.mp4 -vf \
  "fade=t=in:st=0:d=2,fade=t=out:st=27:d=3" \
  -c:a copy out.mp4

Fade the audio with afade

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i in.mp4 -af \
  "afade=t=in:st=0:d=2,afade=t=out:st=27:d=3" \
  -c:v copy out.mp4

Fade picture and sound in one command

Use filter_complex to ramp both streams and map them to the output:

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i in.mp4 -filter_complex "
  [0:v]fade=t=in:st=0:d=2,fade=t=out:st=27:d=3[v];
  [0:a]afade=t=in:st=0:d=2,afade=t=out:st=27:d=3[a]
" -map "[v]" -map "[a]" out.mp4

Fade to a color other than black

Add color=white (or any color) to fade to white instead:

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i in.mp4 -vf "fade=t=out:st=27:d=3:color=white" out.mp4

Or fade on a timeline

FFmpegLab adds fades with handles on the clip and writes the matching fade/afade command for you. For blends between two clips rather than to black, use an xfade transition; to balance the fading soundtrack against other tracks, see audio mixing with amix. Everything runs offline in the browser.

✦  Fresh from the render queue

Better FFmpeg workflows, delivered.

Get practical commands, new templates, and deep-dive guides for the edits that are usually hardest to get right.

✓  Copy-pasteable commands    ✓  Editor templates    ✓  No noise
One useful email at a time.

Polish openings and endings — visually.

Free in your browser — nothing to install, nothing uploaded.