ffmpeg -i input.mp4 -i newaudio.mp3 -map 0:v -map 1:a -c:v copy -c:a aac -shortest output.mp4

Category: Media & Conversion

ffmpeg -i input.mp4 -i newaudio.mp3 -map 0:v -map 1:a -c:v copy -c:a aac -shortest output.mp4

Replace a video's audio track

Swaps the video's audio for newaudio.mp3: -map 0:v takes the original video, -map 1:a the new audio, and -shortest ends at the shorter stream. The video is copied, not re-encoded. Add -af filters to adjust the new track.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.