How to remove all subtitles except one

Hi
I would like to remove all subtitles except HU from video files using command line. How can I do this? I don’t know the track id, because it is different file by file and i have more than 50 files :slight_smile:

Welcome!

I guess that you mean that you want to keep a subtitle track with the language Hungarian by “all subtitles except HU”. Luckily you can select tracks by their language. Therefore it’s as easy as

mkvmerge -o destination.mkv -s hu source.mkv
1 Like

Thank You! It works fine :slight_smile:

You’re quite welcome.

If we want to run the code once, the non-Hungarian subtitles will be deleted, and the subtitles that are alongside and same name to the source file names will be added to the source by default and force flag and with high priority, how can this be done?

It means that a number of non-HU subtitles are deleted and the subtitles of the same name of each source .mkv file are added to the source in the same process.

The following code is for adding subtitles with the same .mkv source name:

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")

How can both processes be called in one execution of the code and what will be the final form of the code?