

So the final command line looks like this: ffmpeg -i "inputpath\input.mkv" -map 0:0 -c:v copy -map 0:2 -c:a copy "outputpath\output.mp4" So you have to write -map 0:2 NOT -map 0:3Īlso, you have to write -map 0:0 in front of -c:v copy because if you don't, ffmpeg will not copy the video stream and you get only the audio stream (If the video has two video streams and you want to copy the second one, you have to write -map 0:1) The first stream is video, the second is default audio, and the third is non-default audio in the language you want. Let's say the video has 3 streams (you can see that in mediainfo).

You have to write -map 0:numberofstreamminusone in front of -c:a copy This is a solution when you copy mkv to mp4 and want to choose audio streams: This is a simple answer for people like me, who like simple working explanations. Because it's the second map option, it is mapped to the second stream in our output. Then we write a second map option: -map 0:2, which refers to the third stream of our input. Then we write a first map option: -map 0:0, which refers to the first stream of our input (tears_of_steel.mkv), which might be a video stream, but that doesn't matter.īecause it's the first map option, it will be mapped to the first stream in our output file (tears_of_steel-v2.mkv). In the command, we have only one input: tears_of_steel.mkv. Imagine the following command: ffmpeg -i tears_of_steel.mkv -map 0:0 -map 0:2 -map 0:1 -map 0:4 -map 0:3 -c copy tears_of_steel-v2.mkvĪnd here is how ffmpeg does the mapping: Stream mapping: This was the example that allowed me to understand.
