VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Hello
    Is there any way to replace subtitle in mkvmerge?

    i'm using this code to remove subtitle
    Code:
    @echo off
    cls
    set rootfolder=C:\1\
    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.
            )
        )
    )
    How can i add another subtitle ( same name ) ?
    I don't want to remux file again
    Quote Quote  
  2. What exactly do you mean by "same name"?

    Giving an example, you have 2 files:
    movie.mkv
    subtitle.srt
    Then removing the embed subtitles from movie.mkv while at the same time adding subtitle.srt is simply:
    mkvmerge -o "output.mkv" -S "movie.mkv" "subtitle.srt"

    So, if by "same name" you mean movie.mkv and movie.srt you just add "%%~dpna.srt" to the muxing command of your script:
    Code:
    @echo off
    cls
    set rootfolder=C:\1\
    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" "%%~dpna.srt"
                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.
            )
        )
    )
    Last edited by sneaker; 29th Mar 2016 at 13:52.
    Quote Quote  
  3. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    You can use mkvbatch to remove all the existing subtitles and insert new ones,no need to write a script.
    I think,therefore i am a hamster.
    Quote Quote  
  4. Thanks guys!
    Quote Quote  
  5. Hi Guys,
    I realize this is a very old thread.

    I have been using the script in #2 above for years and it always worked.
    All I want to do is to remove the subtitles from all the MKV files in a folder.

    It has been working perfectly.

    Just the other day it stopped working.
    I am seeing an error message:

    HTML Code:
    'find' is not recognized as an internal or external command,
    operable program or batch file.
    I am using windows7 with mkvtoolnix-64-bit-66.0.0-setup.
    I don't remember changing anything in windows.
    Does anyone know what could be wrong?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!