0
0
@echo off
cls
set rootfolder=C:\
echo Enumerating all MKVs under %rootfolder%
echo.
for /r %rootfolder% %%a in (*.mkv) do (
for /f %%b in ('mkvmerge --identify-verbose "%%a" ^| find /c /i "subtitles"') do (
if [%%b]==[0] (
echo "%%a" has no subtitles
) else (
echo.
echo "%%a" has subtitles
mkvmerge -q -o "%%~dpna (No Subs)%%~xa" -S "%%a"
if errorlevel 1 (
echo Warnings/errors generated during remuxing, original file not deleted
) else (
del /f "%%a"
echo Successfully remuxed to "%%~dpna (No Subs)%%~xa", original file deleted
)
echo.
)
)
)
Which finds all MKV files recursively from a specified path, and removes all subtitles from the MKV files found (if the MKV found contains subtitles), finally deleting all the original MKV files that had the subtitles removed.
I'm looking to add when it runs mkvmerge -i
if has English subtitles, tell it to extract them to the directory of the MKV file before remuxing (using mkvextract).
Does
mkvmerge -i
show the language of the subs? – Endoro – 2013-05-25T05:05:34.630No, looks like I'm asking the wrong question. – David Custer – 2013-05-25T06:07:58.703
It shoes the language with the
mkvmerge --identify-verbose
switch. – Endoro – 2013-05-25T06:17:34.210IT DOES!! Yay were getting somewhere!!! – David Custer – 2013-05-25T09:40:42.647
Edited the batch file to include --identify-verbose above. – David Custer – 2013-05-25T09:49:33.840
1
The issue is,
– Endoro – 2013-05-25T11:02:31.077mkvmerge --identify-verbose
makes strings with lenghts over 13,000 chars, look here, this is more for and findstr can treat. Therefore I would suggest to use sed in the batch script.1
And, moreover, there is a nice GUI for batch demuxing, mkvcleaver.
– Endoro – 2013-05-25T11:42:37.343I have SAB***d run a batch script that has 4 other batch scripts. I'm not looking to use a GUI manually. – David Custer – 2013-05-25T22:00:48.793