I have got two video files: .mp4, with a single (incorrect) audiostream, and an .mkv, with two audio streams (one incorrect, the other correct)
Is there a way to replace the audio of the .mp4 file with the second stream in the .mkv?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Sure, with avconv (same as ffmpeg)
avconv -i INPUT_FILE_WITH_BROKEN_SOUND.mp4 -i SECOND_INPUT_FILE.mkv -c copy -map 0:v:0 -map 1:a:1 OUTPUT.mp4
-c copy copies tracks instead of re-encoding them
-map 0:v:0 selects track to be copied to output: 1st file -> video tracks -> 1st video track
-map 1:a:1 selects track to be copied to output: 2nd file -> audio tracks -> 2nd audio track
Hope it helps!