VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Member
    Join Date
    Jan 2016
    Location
    Qatar
    Search Comp PM
    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
    Quote Quote  
  2. The parentheses are not escaped. The FOR ... DO loop ends at the first ) and --sub-charset is interpreted like a new command by Windows.
    Quote Quote  
  3. Member
    Join Date
    Jan 2016
    Location
    Qatar
    Search Comp PM
    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.
    Quote Quote  
  4. Put ^ before parantheses of the mkvmerge command.

    http://www.robvanderwoude.com/escapechars.php
    Quote Quote  



Similar Threads

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