Friday 24 August 2018

ffmpeg - .MKV to .MP4 with 2 soundtrack (audio)

I found this thread: Handbrake settings to convert MKV to MP4 while retaining the original quality


And I can "convert" .MKV to .MP4 with the following code:


for %%a in ("*.mkv") do D:\Programme\Converter\ffmpeg\bin\ffmpeg.exe -i "%%a" -c:v copy -c:a copy "%%~na .mp4"
pause

The only problem is, that there are 2 audio lanes. The german, and the english. With the code above, it only copies the german (1st) language. But not the 2nd audio language. How can I do that?


At the moment I just convert from .MKV to .MP4 with german lang only. But I want to be able to switch the language with my VLC player from german to english.


Thanks for your help!


EDIT: I found that thread here: http://ffmpeg.gusari.org/viewtopic.php?f=25&t=611


And I tested with that informations. I changed my code above, to this code:


for %%a in ("*.mkv") do D:\Programme\Converter\ffmpeg\bin\ffmpeg.exe -i "%%a" -map 0:0 -map 0:1 -map 0:2 -c:v copy -c:a:0 copy -c:a:1 copy "%%~na.mp4"
pause

Did I do something wrong here? How could I add the german / english subtitles to that? IF I would add a subtitle map thing there, and my .MKV have no subtitles at all, would this be a problem? I just want to create a .bat file which converts a .MKV with 2 soundtracks and 2 subtitles. So that I can "remux" (or convert dunno) all my .MKV files to .MP4 without losing any informations.


At the moment, my .MKV have no subtitles, so it's not important. But it's better to prepare for the future, right?


So please tell me if I did it right, and perhaps how to add the subtitles too. It's the first time I ever used FFmpeg. Just downloaded it, never heared about it. Never really used the CMD for that.

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...