0 Replies - 346 Views - Last Post: 24 May 2013 - 05:08 PM Rate Topic: -----

#1 davidcuster91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-May 13

Find all MKV files and remove all subtitles

Posted 24 May 2013 - 05:08 PM

So far I have this:

@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 -i "%%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 remove 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.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1