64 bit - Windows 10 Pro - MKVToolNix V38.0.0
I've got a season of anime that I ripped to edit using a batch. This batch renames the title of the MKV to the file name. It also removes unwanted audio and subtitle tracks.
```
dir/b/s *.mkv >list.txt for /F "delims=;" %%F in (list.txt) do "C:\Program Files\mkvtoolnix\mkvpropedit" "%%F" --edit info --set "title=%%~nF" del list.txt
FOR /F "delims=*" %%A IN ('dir /b *.MKV') DO "C:\Program Files\MKVToolNix\mkvmerge.exe" -o "fixed_%%A" -a !1,2,4 -s !5,6 --compression -1:none "%%A" mkvmerge -o "${file%.mkv}".nosubs.mkv --no-subtitles "$file" PAUSE
```
Now I force in an Srt externally to the new (fixed_) file. To do that I transfer the fixed MKV and external Srt into a new folder and use this batch.
```
for %%A IN (*.mkv) do ( "C:\Program Files\MKVToolNix\mkvmerge.exe" -o "remux-%%~nxA" "%%~A" --forced-track "0:yes" --default-track "0:yes" --track-name "0:English" --language "0:eng" "%%~nA.srt" )
```
It gets the job done but I always end up having two copies at the end. The fixed and the remux MKV files. Its very draining to continually move the fixed files in to a new folder to get it remuxed. It's also sucks to type in the audio and subtitle track numbers I don't want. A show of mine has 19 total subtitles for each episode. I have to type 2-19 in the code just to keep the first track. I was wondering if my two batches could be merged into one batch file.
This batch would change the the MKV title to the file name, it would keep 1 specific audio or subtitle track without needing to list the ones I don't want, lastly it would insert that external Srt in. All of this will be done from the source file to the edited copy.
Thanks
[Attachment 50734 - Click to enlarge]
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 10 of 10
Thread
-
-
Code:
for %%a in (*.mkv) do mkvmerge --title "%%~na" -o "fixed\%%~a" -a 3 -s 7 "%%~a" --forced-track "0:yes" --default-track "0:yes" --language "0:eng" "%%~na.srt"
-
I appreciate the advice on removing tracks from an MKV file. Now I just need one full code to add the whole process together.
-
What is not "full" about my code? I think it already fullfills all your requirements. It sets the title, removes unwanted tracks and adds the srt.
-
Really? Sorry, I thought you were advising me to to just remove the ! in the tracks for this code.
Code:FOR /F "delims=*" %%A IN ('dir /b *.MKV') DO "C:\Program Files\MKVToolNix\mkvmerge.exe" -o "fixed_%%A" -a !1,2,4 -s !5,6 --compression -1:none "%%A" mkvmerge -o "${file%.mkv}".nosubs.mkv --no-subtitles "$file" PAUSE
-
Replace "mkvmerge" by the full path "C:\Program Files\MKVToolNix\mkvmerge.exe".
(I have the MKVToolNix folder in %PATH% so I don't need it on my PC.) -
-
-
It depends on your player and how you set it up. Depending on that it might select the tracks from the order (TrackID), from the language, quality (e.g. 5.1 FLAC over 2.0 MP3), default/forced flags, track title ...
See documentation of your player. From mkvmerge doc see --track-order option.
Similar Threads
-
Code 19
By cornemuse in forum ComputerReplies: 8Last Post: 25th Dec 2017, 11:43 -
Beep Code??
By cornemuse in forum ComputerReplies: 29Last Post: 1st Apr 2016, 11:06 -
Channel code
By arnfsilva in forum Video Streaming DownloadingReplies: 0Last Post: 21st Oct 2015, 05:47 -
Lg code free
By Ruffnut in forum DVD & Blu-ray PlayersReplies: 1Last Post: 28th Apr 2015, 22:59 -
Rip DVD, no transcode, files created by chapter range (TV show, seasons)
By Nerevarine in forum DVD RippingReplies: 4Last Post: 18th Mar 2015, 16:44