Possible to remove non-english subtitles from MKV's ??
Possible to remove non-english subtitles from MKV's ??
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
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
Re: Possible to remove non-english subtitles from MKV's ??
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.
Please read the FAQ and How to Request Help.
Re: Possible to remove non-english subtitles from MKV's ??
Thanks for quick your response.
Will try to figure out 3rd party tools for the purpose.
Will try to figure out 3rd party tools for the purpose.
Re: Possible to remove non-english subtitles from MKV's ??
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?
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?
Re: Possible to remove non-english subtitles from MKV's ??
I don't see why not
you can something like this:
sample
you can something like this:
Code: Select all
{ text.collect{[ 'ID': it.StreamKindID, 'Count': it.StreamCount, 'Language': it.LanguageString,'Default': it.Default]} }
[{ID=0, Count=34, Language=English, Default=Yes}, {ID=1, Count=34, Language=English, Default=No}, {ID=2, Count=34, Language=Arabic, Default=No}]
Re: Possible to remove non-english subtitles from MKV's ??
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.
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 }'
Please read the FAQ and How to Request Help.
Re: Possible to remove non-english subtitles from MKV's ??
Apologies but unable to understand the above coderednoah wrote: ↑10 Sep 2021, 02:40 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 }'
Will try the code snippet by Kim and then will try to figure this one.
Re: Possible to remove non-english subtitles from MKV's ??
Tried this code snippet and finally able to understand it too This code snippet provides the track number for EACH subtitle track along the total number of subtitle tracks.kim wrote: ↑10 Sep 2021, 01:17Code: Select all
{ text.collect{[ 'ID': it.StreamKindID, 'Count': it.StreamCount, 'Language': it.LanguageString,'Default': it.Default]} }
Please advise on how to modify this to provide the track number for ONLY those subtitles for which the language is either 'eng' or 'und' and not provide the track information for any other language??
Re: Possible to remove non-english subtitles from MKV's ??
filebot -find -exec allows you to find files and then call arbitrary commands on them, e.g. find files with English subtitles, and then call ffmpeg on the file with some custom options, some of which are constant, some of which are generated and provided by FileBot (e.g. subtitle stream ID for English subtitle track).
e.g. filter in files that have an English subtitle track; ignore all other files:
e.g. call echo with English subtitle stream ID as $1 and absolute file path as $2:
You'll want to replace echo with your own custom script that takes in English subtitle stream ID as $1 and absolute file path as $2 and then call ffmpeg to do something, e.g. re-encode the container to a new file while keeping only the given subtitle stream ID.
(I'm not too familiar with using the ffmpeg command-line tool, so I can't give you copy & paste solution for this part)
e.g. filter in files that have an English subtitle track; ignore all other files:
Code: Select all
--filter '/en/ in text.Language'
Code: Select all
-exec echo '{ text.find{ it.Language == /en/ }.ID }' '{ f }'
(I'm not too familiar with using the ffmpeg command-line tool, so I can't give you copy & paste solution for this part)
Please read the FAQ and How to Request Help.