VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. 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 ↓


    Quote Quote  
  2. try this one

    Code:
    for %%x in (*.mp4) do "C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%%~nx.mkv" "%%~x" "%%~nx-en.m4a"
    Quote Quote  
  3. Originally Posted by iKron View Post
    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"
    Now it merges the 2 audio files, however, they both have the same name and both are standard track. Is there a way to change the name of the tracks and leave the first one as default?

    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.

    Image
    [Attachment 64685 - Click to enlarge]
    Quote Quote  
  4. 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
    Quote Quote  
  5. Originally Posted by iKron View Post
    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
    Thank you so much for taking the time to help me. Problem solved! All the best for you \ o

    Before:
    Image
    [Attachment 64688 - Click to enlarge]




    After:
    Image
    [Attachment 64689 - Click to enlarge]
    Quote Quote  
  6. Member
    Join Date
    Aug 2023
    Location
    Ukraine
    Search PM
    how to add two subtitle files, type full, and one force file, but by default all subtitles are disabled, using a batch script for program mkvmerge?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!