VideoHelp Forum


Try NordVPN to access Netflix or other streaming services from any country and also surf safe!
+ Reply to Thread
Results 1 to 2 of 2
Thread
  1. I have pieced together a .bat routine for merging .srt's into multiple .mkv's.

    What I'm having some difficulty with is the "track-name" for the subpic. Getting error trying to get it to fill in the track name.

    EDIT: Works fine for filling in the track-name for Video and Audio defined in the .json file.

    It errors out an the track-name for the merged subtitle comes out BLANK

    Warning: '<filename>.srt': A track with the ID 2 was requested but not found in the file. The corresponding option will be ignored.

    The bat routine uses a .json file to apply the values / labels to the "track-name" field.

    Any help getting the "track-name" to fill-in properly on the subtitle will be greatly appreciated. The video and audio "track-name" is filling in correctly.

    Code:
    @echo off
    set mkvmerge="F:\Media\MKVToolNix\mkvmerge.exe"
    if not exist "MergeOptions.json" (
        echo Options file 'MergeOptions.json' not found. Exiting.
        pause>nul
        exit
    )
    if not exist "mkvmerge_out" (mkdir "mkvmerge_out")
    for %%f in (*.mkv) do %mkvmerge% @MergeOptions.json -o "mkvmerge_out/%%~nf.mkv" "%%~f" "%%~nf.srt"
    echo.
    echo ============================
    echo Done. Press any key to exit.
    pause>nul
    exit
    Code:
    [
      "--ui-language",
      "en",
      "--no-track-tags",
      "--no-global-tags",
      "--language",
      "0:eng",
      "--track-name",
      "0:480p Video",
      "--default-track",
      "0:yes",
      "--language",
      "1:eng",
      "--track-name",
      "1:AAC 2ch",
      "--default-track",
      "1:yes",
      "--language",
      "2:eng",
      "--track-name",
      "2:Non-Hearing Impaired",
      "--default-track",
      "2:yes",
      "--title",
      "",
      "--track-order",
      "0:0,0:1,0:2"
    ]
    The complete .bat and .json files attached.

    FYI: I'm very new to using the command line for mkvmerge, mainly been using the MKVToolNix GUI.
    Image Attached Files
    Last edited by sailor420; 20th Jun 2021 at 18:03.
    Quote Quote  
  2. SOLVED:

    Code:
    for %%f in (*.mkv) do %mkvmerge% -o "mkvmerge_out/%%~nf.mkv" --no-subtitles "%%f" "%%~nf.srt"    
    
    xcopy ".\mkvmerge_out\*.mkv" ".\*.mkv" /D /C /I /Y
    
    for %%f in (*.mkv) do %mkvmerge% @%mkvjsons%%jsonname%%jsonsext% -o "mkvmerge_out/%%~nf.mkv" --title "%%~nf" "%%~f"

    Having to dance the TWO STEP, best I could figure out, it's not pretty, but it works !!
    Quote Quote  



Similar Threads