Hello,
from time to time I have a bunch of mkv files with included english subs in which I want to mux some external .ass subtitles. But, the tricky thing is that I want to keep the existing (english) subs, and add external (serbian) subs, BUT I want to put external subs to be above the existing ones, and to make them default.
When I do that in Mkvmerge for single files, everything is fine, offcourse, but when I tried do find some scrpt to do that in batch command, there is some problem.
Just for the testing purposes, I used the command from Mkvmerge and put it in a *.bat file and run it through command prompt, and it worked with all the settings as I created them which was to be expected, offcourse, but when I tried the script bellow, for some reason it gives me "--sub-charset" was unexpected at this time error. It acts like it can't recognize that attribute when in batch script mode for some reason :/
Not sure if anyone had a similar problem, cause I really tried to find it but to no avail.
I even tried removing that attribute, but then it gives the same error about the next attribute in line, and so on.
If needed, I'm using win7 64 ultimate, i5, 8GB RAM, and MKVToolNix 8.6.1.
Code:for %%f in (*.mkv) DO ("C:/Program Files/MKVToolNix\mkvmerge.exe" ^"--ui-language^" ^"en^" ^"--output^" ^"D:/^!stvari za prevodjenje/Gate #1/mux/%%~nf.mkv^" ^"--language^" ^"0:und^" ^"--default-track^" ^"0:yes^" ^"--compression^" ^"0:none^" ^"--language^" ^"1:jpn^" ^"--track-name^" ^"1:Stereo^" ^"--default-track^" ^"1:yes^" ^"--compression^" ^"1:none^" ^"--language^" ^"2:eng^" ^"--compression^" ^"2:none^" ( ^"D:/^!stvari za prevodjenje/Gate #1/%%~nf.mkv^" ) ^"--sub-charset^" ^"0:UTF-8^" ^"--language^" ^"0:srp^" ^"--default-track^" ^"0:yes^" ^"--compression^" ^"0:none^" ( ^"D:/^!stvari za prevodjenje/Gate #1/%%~nf.ass^" ) ^"--attachment-name^" ^"CENSCBKB.TTF^" ^"--attachment-mime-type^" ^"application/x-truetype-font^" ^"--attach-file^" ^"D:/^!stvari za prevodjenje/CENSCBKB.TTF^" ^"--track-order^" ^"0:0,0:1,1:0,0:2^")
I'm not so experienced in scripting, so I would be really grateful if someone could lend a helping hand in this matter
Thanks in advance![]()
+ Reply to Thread
Results 1 to 4 of 4
-
-
The parentheses are not escaped. The FOR ... DO loop ends at the first ) and --sub-charset is interpreted like a new command by Windows.
-
ok, but how should I escape them?
Somewhere else I found that you escape them with '(' and \( and '\(' and "\(" but I tried all three combinations and that didn't do the trick :/
Could you just tell me how to escape them? Since I already mentioned, I'm not experienced in scripting. -
Put ^ before parantheses of the mkvmerge command.
http://www.robvanderwoude.com/escapechars.php
Similar Threads
-
MKVMERGE Batch Muxing multiple audio and subtitle tracks?
By jahob000 in forum Newbie / General discussionsReplies: 38Last Post: 30th May 2023, 19:13 -
Reduced video size after muxing with mkvmerge
By sazolis in forum Newbie / General discussionsReplies: 11Last Post: 31st Dec 2015, 14:33 -
Muxing with mkvmerge
By sharu006 in forum Video ConversionReplies: 7Last Post: 14th Dec 2012, 11:48 -
mkvmerge muxing shortens duration of video
By Torky in forum Video ConversionReplies: 2Last Post: 20th Apr 2012, 22:20 -
Batch subtitle muxing - mkvmerge
By mkr10001 in forum EditingReplies: 1Last Post: 18th Feb 2012, 12:03