Possible to remove non-english subtitles from MKV's ??

Any questions? Need some help?
Post Reply
ca81
Posts: 21
Joined: 14 Dec 2019, 20:08

Possible to remove non-english subtitles from MKV's ??

Post by ca81 »

Hi,

I have been using FileBot for a while to rename TV episodes and Movie files and it's an awesome piece of software :)
I am not aware of all the functionality that FileBot offers so in case this is a dumb question please ignore.

Want to check if it is possible for FileBot to remove all non-english subtitles from *.mkv or *.mp4 files....i.e. I have multiple *.mkv files that have subtitles for multiple languages muxed in the file. As I do not need subtitles for any language other than English, I want to check if there is a way by which FileBot can remove the non-english subtitles from *.mkv or *.mp4 files when renaming TV episodes or Movies ?
If yes, then can someone please advise how can it be done.

peace,
~kg
User avatar
rednoah
The Source
Posts: 20061
Joined: 16 Nov 2011, 08:59

Re: Possible to remove non-english subtitles from MKV's ??

Post by rednoah »

FileBot does not modify files, and so it cannot remove subtitle streams from container files. There are 3rd party tools (e.g. ffmpeg command-line tool) that can do what you want, but likely only by copying / rewriting the entire file.
:idea: Please read the FAQ and How to Request Help.
ca81
Posts: 21
Joined: 14 Dec 2019, 20:08

Re: Possible to remove non-english subtitles from MKV's ??

Post by ca81 »

Thanks for quick your response.
Will try to figure out 3rd party tools for the purpose.
ca81
Posts: 21
Joined: 14 Dec 2019, 20:08

Re: Possible to remove non-english subtitles from MKV's ??

Post by ca81 »

On a 2nd thought.
Would FileBot be able to identify if a *.mkv file has English subtitles and if yes then provide the track number for the English subtitle along with the total number of subtitiles?
kim
Power User
Posts: 1145
Joined: 15 May 2014, 16:17

Re: Possible to remove non-english subtitles from MKV's ??

Post by kim »

I don't see why not

you can something like this:

Code: Select all

{ text.collect{[ 'ID': it.StreamKindID, 'Count': it.StreamCount, 'Language': it.LanguageString,'Default':  it.Default]} }
sample
[{ID=0, Count=34, Language=English, Default=Yes}, {ID=1, Count=34, Language=English, Default=No}, {ID=2, Count=34, Language=Arabic, Default=No}]
User avatar
rednoah
The Source
Posts: 20061
Joined: 16 Nov 2011, 08:59

Re: Possible to remove non-english subtitles from MKV's ??

Post by rednoah »

You can use filebot -find -exec to find the files you want to rewrite, and then generate rewrite commands:
viewtopic.php?t=12622

e.g.

Code: Select all

filebot -find . --filter '/en/ in text.Language' -exec echo '{ text.find{ it.Language == /en/ }.ID }' '{ f }'
:idea: Please read the FAQ and How to Request Help.
Post Reply