I downloaded a movie in beautiful HD. Unfortunately, the sound is broken. I then downloaded a different copy in low res, but with an intact soundtrack. How can I use ffmpeg to take the sound from the latter and combine it with the video from the former?

I do not know what details about the files to put here, please let me know which commands I should post the output of. All I know is the first one's an mkv and the second's an avi.


You can use -map to choose which streams you want, then use -c copy to stream copy (re-mux).

This example will copy the video stream(s) from hd.mkv and the audio stream(s) from sd.avi:

ffmpeg -i hd.mkv -i sd.avi -map 0:v -map 1:a -c copy -shortest output.mkv

If you want to offset one of the inputs see the -itsoffset option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.