View Full Version : MKVmerge Batch File - Default Track
tosh9i
18th September 2011, 20:55
I have some dual audio files. ID 2 is set as default. I want to switch ID 3 to default and disable the subtitles (ID 4) (not remove just disable so user can reenable them). So, I'm hoping that someone can provide me a script to make that possible.
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"
sneaker_ger
18th September 2011, 22:27
Try:
FOR %%A IN (*.mkv) DO mkvpropedit %%A --edit track:a1 --set flag-default=0 --edit track:a2 --set flag-default=1 --edit track:s1 --set flag-default=0
I haven't tested it, so report any errors. Note that mkvpropedit does not remux, so it is a lot faster than mkvmerge.
tosh9i
18th September 2011, 23:36
Well, it sort of worked. When I first tried it, a window quickly opened and closed, but there were no changes to the file. I then renamed the file to 01.mkv and modified the script so that it'd only redo that file with that name. Then it "sort" of worked. When I opened the file, Explorer crashed, so now I can't even click on the file, so I had to delete it using a command window. But before, that, I used mkvmerge to remux it, and now I can open it and the audio and subtitle is set correctly.
So can you show me how to remux it.
sneaker_ger
19th September 2011, 00:47
That are a lot of different problems, I fear.
Add the line "pause" to the last line of your batch, so that the window doesn't close immediately and you have time to read any error message. You may need to put %%A into quotes to make it work on file names with spaces.
If your explorer crashes it may be the fault of the thumbnail function, usually observed when DivX is installed in combination with the header removal compression used by newer mkvmerge versions.
I could tell you how to (un)set the default flag by remuxing, but I feel that mkvpropedit is so much more suited for this task, that I'd rather help you get it to work. (Or you could take a look at the mkvmerge documentation (http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html))
Many players offer a function to configure the audio and subtitle track selection according to your individual needs, btw. Setting up your player correctly might save you the hassle of having to fiddle with the files themselves.
tosh9i
19th September 2011, 04:01
well, I decided to use your script on the other files. Then I just remuxed them using the other script. It's a two step process, but a hell of lot easier than doing it one by one.
Thanks again for the help.
Foofaraw
7th October 2011, 18:04
Man, the docs for this is severely lagging.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.