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 exitThe complete .bat and .json files attached.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" ]
FYI: I'm very new to using the command line for mkvmerge, mainly been using the MKVToolNix GUI.
+ Reply to Thread
Results 1 to 2 of 2
-
Last edited by sailor420; 20th Jun 2021 at 18:03.
-
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 !!
Similar Threads
-
Batch file to extract/convert all tx3g files in an .mp4 file
By olpdog in forum SubtitleReplies: 1Last Post: 23rd Aug 2020, 18:40 -
Batch file to create nfo files for multiple videos
By olpdog in forum ProgrammingReplies: 2Last Post: 16th Jul 2019, 12:47 -
FFMpeg merging audio files truncates output to shortest audio file
By Wayneos in forum Video ConversionReplies: 0Last Post: 3rd Jul 2019, 07:07 -
Merging MKV extracted files to playable MKV video file
By deepfrayder in forum EditingReplies: 9Last Post: 12th Dec 2017, 23:17 -
Batch merging MKV and SRT
By Fransman6080 in forum Newbie / General discussionsReplies: 3Last Post: 26th Jun 2016, 03:27