Thus, it is difficult to define what qualifies you as first (or english.str), so you would go into this part to make the adjustment if necessary replacing the current command in the function with one of the possible commands below: Understand that we don't know what to make the output true to the objective and we didn't even see the file, the file name, creation/change date or even its content. MKVTOOLNIX MP4 CODEThe trickiest part using this code would be to adjust the command that returns you to the correct subtitle. )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 MKVTOOLNIX MP4 FULL:: %4 = "%_mkv%" = the full path to the mkvmerge executable MKVTOOLNIX MP4 MP4:: %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
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |