Cheatsheet Pages / FFmpeg Cheatsheet

How to replace a video's audio track — ffmpeg -map

The picture is right but the sound is wrong: new music, a fixed voice-over, a different language.

ffmpeg -i video.mp4 -i new_audio.mp3 -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 -shortest output.mp4
# -map picks streams explicitly; -shortest ends output at the shorter input

Good to know

-map picks the streams explicitly; -shortest ends the output at the shorter input.

FFmpeg Cheatsheet one-page card — 28 commands that actually work
The full one-page card — FFmpeg Cheatsheet. Get the complete cheatsheet on GitHub