Page 1 of 1
Is it possible to automatically eliminate redundant forced subtitle tracks?
Posted: Fri Nov 01, 2024 2:04 am
by aqqor
Hi, I'm a new member here.
Currently, if a subtitle track contains no forced subtitles, MakeMKV offers a mechanism that eliminates the streams from the finished MKV file. Is it possible to do the same for music with completely forced subtitles?
I have two identical subtitle tracks on my rips, which isn't really a problem but is a little bothersome. The English sign-language subtitle tracks on the Planet of the Apes Trilogy collection are like this.
Re: Is it possible to automatically eliminate redundant forced subtitle tracks?
Posted: Sat Nov 09, 2024 7:54 pm
by dyoung
There are 2 different types of subtitles people commonly call "forced", so clarification would help.
1- Subtitles which are displayed only to translate otherwise untranslated dialogue or on-screen text. I would prefer a better term than forced, but this is what "forced subtitles" correctly refers to.
2- Subtitles which always display and are not in the list of subtitle streams because they are "burnt-in" to the video. I found some people refer to these as forced subtitles but they are not forced, they are embedded in the video itself at which point they cannot be disabled or removed.
Which of those are you referring to?
Actually, it could also be default, not forced.
As an example, I found my media with separate subtitles files active those external subtitles by default when I play on some of my devices. I think VLC on my PC was 1 of them which auto-enables external sub files, but perhaps it is a setting I can change. I found VLC wonky with default/forced/external subtitles, where it would never play default or forced internal subs unless I selected them manually or set VLC's setting to default select subs (which caused it to *always* enable the 1st matching subtitle track), and it *always* enables external subtitles files forcing me to manually disable them each time the media begins playing.
The device/software you use to play media can definitely affect resulting display (or non-display) of subtitles, so it could be helpful to know your playback device & software.
Regarding solving the issue, I am not yet familiar enough with MakeMKV to know if it can "eliminate redundant forced subtitle tracks", but I would suggest trying MKVToolNix as a supplement.
Use MakeMKV to rip your media, use MKVToolNix to fix any resulting problems.
MKVToolNix does not transcode your MKV files, merely remuxes them, so it can VERY quickly alter MKV files.
Examples?
It can add audio or subtitle streams to an existing MKV file, or remove audio & subtitle streams from an MKV file, and it does it with almost no processing.
It can alter metadata of the MKV file, from altering display settings such as aspect ratios with no re-encoding to adding/altering stream information.
It can repair files processed by Handbrake. Yeah, I found Handbrake causes problems in resulting files. While they technically play correctly, it strips information from them such as stream bitrate & size, and somehow creates a larger file despite removing information. I use MediaInfo often to compare differences resulting from various settings in Handbrake, for example ensuring a re-encoded audio stream is not larger than the source. Files created by Handbrake lack the information to compare. MKVToolNix fixes the errors of Handbrake to restore the missing information so I can compare, and it somehow creates a smaller file solely by remuxing Handbrake's output.
Because MKVToolNix can add/remove streams/metadata from MKV files so quickly (as in seconds per GB of the file), I also let MakeMKV include more than I probably want because it is not clear which streams are what when you look at them in MakeMKV, but I can then use MKVToolNix to remove things like audio description streams (you know, where a person describes what is occurring on-screen?) or empty subtitle streams or (insert other thing I want removed here).
But know it must create a separate output file, not directly overwrite the source MKV, because it cannot read the source to remux to alter how you want if the output overwrites the source, so you need enough storage capacity to store input & output files but can delete the input when you are happy.
Re: Is it possible to automatically eliminate redundant forced subtitle tracks?
Posted: Sat Nov 09, 2024 9:14 pm
by flojo
Without remuxing/removing files, Matroska (.mkv/.mka) has 2 main flags that are editable with mkvpropedit that enable the playback of streams:
Code: Select all
"default_track": true,
"forced_track": false,
If forced_track is true (--set flag-forced=1) or default_track is true (--set flag-default=1) then the track should playback. If you set both to false, eg. --set flag-forced=0 --set flag-default=0, then the track should NOT playback, especially if it is a subtitle track (audio/video tracks vary based on player).
Assuming "movie.mkv" has track 1 as video, track 2 as audio, track 3 as SHD subtitles and track 4 as forced subtitles and I want to stop track 4 from displaying:
Code: Select all
mkvpropedit --edit track:4 --set flag-forced=0 --set flag-default=0 movie.mkv
(to get the track number to use, use "mkvmerge -J movie.mkv", track indexing starts at 1, not 0)
If you just want to toggle default streams, mkvpropedit is the way to go, especially when filesizes become large since the operation takes ~0.5 seconds (although there is a deeper/longer scan for malformed .mkv's, but that's out of scope here).
Re: Is it possible to automatically eliminate redundant forced subtitle tracks?
Posted: Tue Nov 19, 2024 3:47 am
by dyoung
flojo wrote: ↑Sat Nov 09, 2024 9:14 pm
If you just want to toggle default streams, mkvpropedit is the way to go, especially when filesizes become large since the operation takes ~0.5 seconds (although there is a deeper/longer scan for malformed .mkv's, but that's out of scope here).
You know, I think I found mkvpropedit years ago but completely forgot it existed. Thanks for mentioning it. 0.5 seconds to alter a few bits is definitely faster than using MakeMKV or MKVToolNix.
Re: Is it possible to automatically eliminate redundant forced subtitle tracks?
Posted: Tue Nov 19, 2024 7:35 am
by Toad King
dyoung wrote: ↑Tue Nov 19, 2024 3:47 am
flojo wrote: ↑Sat Nov 09, 2024 9:14 pm
If you just want to toggle default streams, mkvpropedit is the way to go, especially when filesizes become large since the operation takes ~0.5 seconds (although there is a deeper/longer scan for malformed .mkv's, but that's out of scope here).
You know, I think I found mkvpropedit years ago but completely forgot it existed. Thanks for mentioning it. 0.5 seconds to alter a few bits is definitely faster than using MakeMKV or MKVToolNix.
MKVToolNix can actually edit properties as well without remuxing. You just need to open the file in the "Header editor" section instead of the default "Multiplexer" section.