Hello people how are you?
So, I have a folder with several video files and each video has 2 audios with different languages. I just need a "mkvmerge" batch command to merge two audios into each video. It is possible? I have no idea how to do this, except for mkvtoolnix, the problem is that there are many videos, sometimes more than 50, and doing it manually is very tiring. Even if I copy the mkvtoolnix commands it's cumbersome as I would have to copy and edit each file line by line and create a batch.
If it's not possible, no problem, I'll do it manually.
I've searched the internet about this, but haven't found anything similar.
My files look like this ↓
![]()
+ Reply to Thread
Results 1 to 6 of 6
-
-
try this one
Code:for %%x in (*.mp4) do "C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%%~nx.mkv" "%%~x" "%%~nx-en.m4a"
-
Hi, thanks for replying. It worked, but it only merges 1 audio. So I did like this.
Code:for %%x in (*.mp4) do "C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%%~nx.mkv" "%%~x" "%%~nx-pt.m4a" "%%~nx-en.m4a"
I tried using the mkvtoolnix command output but it doesn't work. The audio tracks remain with the same title and both as standard audio, maybe that's why I can't change the name or keep only 1 track as default.
I saw that mkvmerge is using track 0: as the default track for the video and for the two audios.
[Attachment 64685 - Click to enlarge] -
i didnot test it but you can try this one, change the language and trackname:
Code:for %%x in (*.mp4) do "C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%%~nx.mkv" "%%~x" --forced-track "0:yes" --default-track "0:yes" --track-name "0:English" --language "0:eng" "%%~nx-pt.m4a" "%%~nx-en.m4a
-
It worked, but both audios still remained as default audio. And track 2 was still unnamed. So, I took a good look at the script and edited it, and I managed to get it the way I needed to.
Here's the code.
Code:for %%x in (*.mp4) do "C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%%~nx.mkv" "%%~x" --default-track "0:yes" --language "0:pt" "%%~nx-pt.m4a" --default-track "0:no" --language "0:en" "%%~nx-en.m4a
Before:
[Attachment 64688 - Click to enlarge]
After:
[Attachment 64689 - Click to enlarge]
Similar Threads
-
MKVMERGE Batch Muxing multiple audio and subtitle tracks?
By jahob000 in forum Newbie / General discussionsReplies: 38Last Post: 30th May 2023, 19:13 -
Mux audio and Video in Mkvmerge using Batch File
By Daringbaaz in forum Newbie / General discussionsReplies: 2Last Post: 18th Oct 2019, 04:30 -
batch Mkvmerge to select only the AC3 audio and ignore any AAC audio
By olpdog in forum EditingReplies: 3Last Post: 11th Aug 2019, 04:00 -
Batch Mkvmerge change default audio, subitle + delete audio
By alloar in forum Newbie / General discussionsReplies: 2Last Post: 8th Jan 2018, 15:38 -
replace multiple tracks using mkvmerge
By bennyutzer in forum EditingReplies: 3Last Post: 20th Sep 2017, 07:16