VideoHelp Forum

Try DVDFab and copy Ultra HD Blu-rays and DVDs! Or rip iTunes movies and music! Download free trial !
+ Reply to Thread
Results 1 to 4 of 4
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 14: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  



Similar Threads