View Full Version : MKVmerge Batch File - Remove Audio Track
tosh9i
27th September 2011, 02:13
I have about 51 video files and I want to remove one of the audio tracks (ID 3), but I don't want to do it one at a time. Instead, I prefer using a script to do the work. Unfortunately, I've been unsuccessful, so I was hoping that someone could help me create a mkvmerge batch script to remove one of the audio tracks (ID 3).
Previously, some people helped me create a batch file to remux some files, and I'm thinking that the second half just needs to be modified:
FOR %%A IN (*.mkv) DO mkvmerge -o "remux-%%~nA.mkv" "%%~A"
7ekno
27th September 2011, 13:10
Previously, some people helped me create a batch file to remux some files, and I'm thinking that the second half just needs to be modified:
For no audio at all, run in a folder with all MKVs to be processed:
FOR /F "delims=*" %%A IN ('dir /b *.MKV') DO "<path_to_mkvmerge>mkvmerge.exe" -o "fixed_%%A" -A -S --compression -1:none "%%A" -A -D "%%A"
7ek
tosh9i
28th September 2011, 01:35
well, that does remove all the audio like you said, but I don't suppose you know of a way to keep one of the audios?
the_weirdo
28th September 2011, 07:48
@tosh9i:
I think the following batch will do what you want (modified from 7ekno's script):
FOR /F "delims=*" %%A IN ('dir /b *.MKV') DO "<path_to_mkvmerge>mkvmerge.exe" -o "fixed_%%A" -a !3 --compression -1:none "%%A"
tosh9i
28th September 2011, 09:11
Unfortunately, when I used that script, a cmd window just opened and closed. However, no changes were made to the mkv file. This is what the screen looked like:
http://i675.photobucket.com/albums/vv113/tosh9i/Clipboard02.jpg
the_weirdo
28th September 2011, 10:15
Unfortunately, when I used that script, a cmd window just opened and closed. However, no changes were made to the mkv file. This is what the screen looked like:
http://i675.photobucket.com/albums/vv113/tosh9i/Clipboard02.jpg
Can you update your mkvtoolnix to latest version and try that batch again (add PAUSE at the end to see what mkvmerge output):
FOR /F "delims=*" %%A IN ('dir /b *.MKV') DO "<path_to_mkvmerge>mkvmerge.exe" -o "fixed_%%A" -a !3 --compression -1:none "%%A"
PAUSE
tosh9i
30th September 2011, 01:10
Worked like a charm, thanks.
flapane
11th February 2012, 13:31
A sidenote: if you're running it inside a cmd shell, substitute %%A with %A (I've just found it out by myself)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.