)do "C:\Program Files\MKVToolNix\mkvmerge.exe" -priority higher -flush-on-close -disable-track-statistics-tags -o "C:\Users\Answer42\Videos\SU-2022\Season1\title1.mkv" "C:\Users\Answer42\Videos\SU-2022\Season1\title1.mp4" -default-language en -language 0:en "C:\Users\Answer42\Videos\SU-2022\Season1\Subs\title1\subfile1.srt" Your commands inside the for /f loop (inside the function/label) and the result obtained in the for loop using the arguments: for /f. :: %6 = "%_flag_1%" = mkv flag to process and output file :: %5 = "%_flag_0%" = mkv flag for process the first subtitle :: input in loop
:: %4 = "%_mkv%" = the full path to the mkvmerge executable
:: %3 = "%%~i" = the full path to the current mp4 file :: %2 = "%%~ni" = the name without extension for the current mp4 :: call %:ˆ) "Season1" "title1" "C:\Users\Answer42\Videos\SU-2022\Season1\title1.mp4" "C:\Program Files\MKVToolNix\mkvmerge.exe" "-default-language en -language 0:en" "-priority higher -flush-on-close -disable-track-statistics-tags -o" "*.srt" When calling a function in bat, it is necessary to pass the variables/string (in arguments) so that it is possible to make use of them: :: call :label/function and passing all arguments |find/v /i "\subs\"ĭir /a:d /b | findstr /ei Season.* |find/v /i "\subs\"ĭir /a:d /b | findstr /ei Season |find/v /i "\subs\"ĭir /a:d /b | findstr /ei Season. The Findstr will filter the subfolders and allow it to run on all that match your folder name layout, below some options to check which one applies best to your scenario dir /a:d /b | findstr /ei Season. Call a function already composing the arguments to be used in it to process the mp4 when the first subtitle\file.srt is found and exit the function immediately. Save the mkv /flags you need and the full path of mkv executable too, and use inside the function ( :label)ĥ. If in that folder there is an any/more.mp4, then this time get their path tooĤ. Use a for /f loop to get the full path of each folder SeasonX\ģ. Save this bat at base/root (1 level above SeasonX\ folders:Ģ. If "%~1" = "" (endlocal & goto :eof)else for /f ^usebackq^delims^= %%# in (`2^>nul ^ Set "_flag_1=-priority higher -flush-on-close -disable-track-statistics-tags -o"įor /f usebackq^delims^= %%G in (`dir /a:d /b ^|findstr Season.* ^|find/v /i "\subs\" Set "_flag_0=-default-language en -language 0:en" Set "_mkv=C:\Program Files\MKVToolNix\mkvmerge.exe" Sorry for the long explanation, but this is really beyond me, and I could use your help. I would then run the batch file for each season, from the same folder as each season's. No need for it to work from season to season unless you are feeling industrious. srt as Language:English and force the DefaultTrack flag. Optionally, since this I can figure out, Mkvmerge.exe should set the. What I am looking for, though, is a batch file that does not involve renaming or moving files. srt) are in the same folder and properly titled.
It works recursively as long as all the files (.mp4 and. 'C:\Program Files\MKVToolNix\mkvmerge.exe' -o "%%~nf_New.mkv" "%%~nf.mkv" -language 0:eng "%%~nf.srt" This 2018 script from Sujay Phadke, is a good start. In other words, the batch file would have srt files do not follow a naming convention where the first file The case, it is safe to assume that I want the first. My problem, and this is something that many others are having to deal with as well, is that under the new release standard: srt are in the same folder and appropriately titled. I can do this, one at a time, using MKVToolNix GUI, but I have been looking for a simpler/faster way to do it with a batch file (or PowerShell script). srt subs in a separate folder, following this folder structure: Season1\title1.mp4
There is a new trend in torrents to release TV and Movies as x265.