How to Add a Lead Out in FFmpeg

This article explains how to create a professional “lead-out” at the end of your videos and audio files using FFmpeg. While FFmpeg does not feature a specific filter named “leadout,” you can easily achieve this exact effect by utilizing the tpad filter to append black frames to the end of a video, the apad filter to extend audio with silence, and the fade filter to create smooth transitions.

Video Lead-Out using the tpad Filter

To add a visual lead-out (such as a black screen or a frozen frame) to the end of a video, use the tpad (temporary padding) video filter. The stop_duration option specifies how many seconds of padding to add to the end of the stream.

ffmpeg -i input.mp4 -vf "tpad=stop_duration=5:stop_mode=add:color=black" output.mp4

If you prefer to freeze the very last frame of your video for the lead-out instead of using a solid color, change stop_mode to clone:

ffmpeg -i input.mp4 -vf "tpad=stop_duration=5:stop_mode=clone" output.mp4

Audio Lead-Out using the apad Filter

If you extend your video stream, you must also extend your audio stream so the player does not cut off early. The apad filter pads the end of an audio stream with silence.

ffmpeg -i input.mp4 -vf "tpad=stop_duration=5" -af "apad" -shortest output.mp4

Creating a Fade-Out Transition

For a more natural lead-out, you can fade both the video and audio to black and silence before the file ends. This is done using the fade and afade filters.

ffmpeg -i input.mp4 -vf "fade=t=out:st=58:d=2" -af "afade=t=out:st=58:d=2" output.mp4