Forced subtitles - flag not being set in MKV file?

Everything related to MakeMKV
pcolmer
Posts: 21
Joined: Sun Apr 19, 2015 6:24 pm

Forced subtitles - flag not being set in MKV file?

Post by pcolmer »

I've been doing a lot of forum reading to try and understand why the movies I've been ripping from Blu-Ray aren't showing the forced subtitles in Kodi.

There have been some really helpful posts and I now appreciate the fact that the m2ts file can contain a subtitle track with both forced and unforced subtitles, but MKV can't, which is why MakeMKV splits the forced subtitles out into their own subtitle track.

HOWEVER, if I then load that MKV file into mkvtoolnix's header editor and look at the subtitle tracks, NONE of them have the "Forced display" flag set.

Is this a bug in MakeMKV, given that it knows that it is creating a subtitle track with forced subtitles in?

Or am I misunderstanding the header editor? It seems to be very clearly telling me that the forced display flag element isn't present in the file.

Thanks.

Philip
Woodstock
Posts: 9933
Joined: Sun Jul 24, 2011 11:21 pm

Re: Forced subtitles - flag not being set in MKV file?

Post by Woodstock »

Actually, the MKV file CAN contain tracks with mixed forced and unforced subtitles. Some players can't deal with that, so MakeMKV has the option of separating the forced ones out to their own track. And, if there are none found, it will delete the forced track.

But mixing forced and unforced is an exception. As you've seen, the more prevalent configuration is two separate tracks, and nothing tagged as forced. And, if there is only one subtitle track for a language, it is most likely "everything", with no flags.

I have no experience with Kodi, but every other player I've used puts the first subtitle track in your chosen language up by default. This is fine if it's the forced track... not so much if the forced track is the second one. You can rearrange the tracks by re-muxing the file. I do that when I'm running them through Handbrake to shrink the video.
MakeMKV Frequently Asked Questions
How to aid in finding the answer to your problem: Activating Debug Logging
Chetwood
Posts: 976
Joined: Mon Aug 30, 2010 9:16 am

Re: Forced subtitles - flag not being set in MKV file?

Post by Chetwood »

Woodstock wrote:Actually, the MKV file CAN contain tracks with mixed forced and unforced subtitles.
Which doesn't matter cause players still adhere to how the track itself is flagged, right? So far I've only seen MPC-HC playing flagged items from a track that itself is not flagged.
pcolmer wrote: Or am I misunderstanding the header editor? It seems to be very clearly telling me that the forced display flag element isn't present in the file.
Most likely because the BD wasn't authored properly, i.e. the forced track wasn't flagged which is why MakeMKV could not recognize it and thus did not flag it in the MKV. If the track (or some items) are flagged as forced, MakeMKV usually flags the track as well. At least that's what the setFirstForcedSubtitleTrackAsDefault="true" in the default.mmcp.xml is for.
MultiMakeMKV: MakeMKV batch processing (Win)
MultiShrink: DVD Shrink batch processing
Offizieller Uebersetzer von DVD Shrink deutsch
Wasabi
Posts: 56
Joined: Mon Aug 17, 2009 11:09 pm

Re: Forced subtitles - flag not being set in MKV file?

Post by Wasabi »

pcolmer wrote:I've been doing a lot of forum reading to try and understand why the movies I've been ripping from Blu-Ray aren't showing the forced subtitles in Kodi.

There have been some really helpful posts and I now appreciate the fact that the m2ts file can contain a subtitle track with both forced and unforced subtitles, but MKV can't, which is why MakeMKV splits the forced subtitles out into their own subtitle track.

HOWEVER, if I then load that MKV file into mkvtoolnix's header editor and look at the subtitle tracks, NONE of them have the "Forced display" flag set.

Is this a bug in MakeMKV, given that it knows that it is creating a subtitle track with forced subtitles in?

Or am I misunderstanding the header editor? It seems to be very clearly telling me that the forced display flag element isn't present in the file.

Thanks.

Philip
If you're using Kodi, there's no need to check the separate "forced only" checkbox. The only way MakeMKV can know to create a separate forced only track is if there are mixed forced and unforced subtitles in the same track, and Kodi knows how to handle those. The header editor will not say that type of track is forced because the individual forced subtitles will be flagged but the track as a whole is not forced. You can use BDSup2Sub to inspect the individual flags.

As far as Kodi is concerned, you only need to go into the video/subtitles settings and make sure that "preferred subtitle language" is set to English (or whatever language you want forced subtitles to appear in). This will handle forced tracks and individual forced subtitles.


Rarer, in my experience, is a completely separate forced subtitle track. Phenomena is one such Blu-ray. The first subtitle track has the entire movie. The second one has only the English subtitles for the occasional foreign dialogue. Kodi would not play either of these automatically because neither has the forced flag set. I'm assuming it's something you would've needed to choose via the Blu-ray menu on a "real" player.

There are also films where there's a completely separate forced subtitle track that is flagged properly. MakeMKV *should* handle these just fine, but as has been mentioned it's not perfect.

I can say, however, that I've never had a problem with XBMC or Kodi not playing the forced subtitles in a mixed track. Just give your language settings a doublecheck.
Chetwood
Posts: 976
Joined: Mon Aug 30, 2010 9:16 am

Re: Forced subtitles - flag not being set in MKV file?

Post by Chetwood »

Wasabi wrote:The only way MakeMKV can know to create a separate forced only track is if there are mixed forced and unforced subtitles in the same track
I was gonna correct you and say it can also detect forced subs if they are in a separate and flagged as forced but as I've just verfied that's not the case. Weird.

Still, I'm gonna rip and flag all my MKVs properly so if standalones finally catching up, I'm not forced to use Kodi (though I like it).
MultiMakeMKV: MakeMKV batch processing (Win)
MultiShrink: DVD Shrink batch processing
Offizieller Uebersetzer von DVD Shrink deutsch
pcolmer
Posts: 21
Joined: Sun Apr 19, 2015 6:24 pm

Re: Forced subtitles - flag not being set in MKV file?

Post by pcolmer »

I've been doing some more testing using my Avengers Blu-Ray as I know where the forced subtitles exist in that film.

If I use PowerDVD, the forced subtitles are displayed correctly without me needing to do anything. I'm going to take that to mean that there is an algorithm that can be followed in order to detect forced subtitles correctly in that film and display them automatically.

If I use Kodi, the forced subtitles are not displayed unless I enable subtitles and select the correct subtitle track, which seems to defeat the whole point of forced subtitles. So that suggests there is a problem with Kodi in its detection of forced subtitles.

Wasabi, you suggested using BDSup2Sub to inspect the flags. From what I've read on the project's web site, it looks like I have to demux the m2ts file first in order to extract the subtitle stream?

If I can inspect the various subtitle tracks off the Avengers in more detail, that will allow me to share further findings and thoughts about MakeMKV's behaviour.
Chetwood
Posts: 976
Joined: Mon Aug 30, 2010 9:16 am

Re: Forced subtitles - flag not being set in MKV file?

Post by Chetwood »

In my experience Kodi DOES show the subs automatically if they are properly flagged, even if Kodi's default setting is subtitles OFF.
MultiMakeMKV: MakeMKV batch processing (Win)
MultiShrink: DVD Shrink batch processing
Offizieller Uebersetzer von DVD Shrink deutsch
pcolmer
Posts: 21
Joined: Sun Apr 19, 2015 6:24 pm

Re: Forced subtitles - flag not being set in MKV file?

Post by pcolmer »

OK ... I'm sharing my findings as I do the research into the subtitles on The Avengers. One of the reasons for picking this Blu-Ray is because there are a number of forum posts on the Kodi forums as well about it so I want to really get to the bottom of this ...

According to tsMuxeR, for 00800.m2ts (which is the main film), there are three subtitle tracks - 4608, 4609 and 4610.

4608 looks like it is the "English for the hearing impaired" track.
4609 looks like it is the "English" track.
4610 contains the English subtitles for the foreign speech so would be considered to be the "forced subtitles" track. The individual subtitles are not marked as forced according to BDSup2Sub.

I thought I had read that it was possible for an entire track to be marked as forced - or is that in MKV only and not M2TS? If it is in M2TS, what tool can I use to display the forced flag (or all flags) for the subtitle tracks?
Chetwood
Posts: 976
Joined: Mon Aug 30, 2010 9:16 am

Re: Forced subtitles - flag not being set in MKV file?

Post by Chetwood »

That's in MKV, I don't know how it's done in m2ts. To verify what streams are which, open the BD in BDtoAVCHD and select scan bitrates. This tool's routines usually can detect forced streams in m2ts even when the items themselves aren't flagged.

Also, if you want us to verify this ourselves, you could upload a 5 min clip or so. You can trim the m2ts in m2ts muxer or to give us the whole BD structure, select main movie in DVDfab and only select chapter 1 only (assuming that's where the forced subs are in). If you deselect HD audio, the file shouldn't get too big to upload to sendspace.com or something.
MultiMakeMKV: MakeMKV batch processing (Win)
MultiShrink: DVD Shrink batch processing
Offizieller Uebersetzer von DVD Shrink deutsch
pcolmer
Posts: 21
Joined: Sun Apr 19, 2015 6:24 pm

Re: Forced subtitles - flag not being set in MKV file?

Post by pcolmer »

I am now as certain as I can be that the 3rd subtitle track on the Avengers Blu-ray, despite definitely containing the "forced" subtitles, doesn't have the forced flag set on any of the subtitles. This would explain why MakeMKV isn't doing anything special with that track and why Kodi doesn't display the "forced" subtitles even when playing the disc itself.

From the reading I've been doing on other forums, it would seem that this can be quite a common approach but the reason it works on proper Blu-ray players (hardware or software) doesn't seem to be entirely clear. The consensus seems to be that the track is being set either in a file or by the JAVA code. I'm going to do some more research to see if I can find out for certain, partly to satisfy myself, but I'm not too hopeful that I will get a definitive answer. If it is being set in a file, it could be possible to then check that file in MakeMKV. If it is being set in JAVA code, however, that is a whole different ballgame :(

In the meantime, I'm going to re-check the other BRs I own that have forced subtitles in order to see if they are like the Avengers (i.e. separate track, no flags) or have a track of mixed subtitles. In the case of the latter scenario, I want to check the output from MakeMKV and double-check the behaviour in Kodi.
Chetwood
Posts: 976
Joined: Mon Aug 30, 2010 9:16 am

Re: Forced subtitles - flag not being set in MKV file?

Post by Chetwood »

pcolmer wrote:The consensus seems to be that the track is being set either in a file or by the JAVA code.
It's probably set in the MovieObject.bdmv by navigational commands which MakeMKV apparently does not check for (nor does it look like Mike's planning on doing something about that). How BD2AVCHD does is anyone's case, maybe it has does a routine that's comparing subtitle sizes and track numbering like

if track = #2 of certain language + item count < x then forced.

Anyway, your problem should be solved. Now that you've identified the track MakeMKV couldn't, you simply have to set the default and forced track to yes in MKVToolnix's header editor (or better yet, also remux the file so this track is first) and Kodi will automatically show them.
MultiMakeMKV: MakeMKV batch processing (Win)
MultiShrink: DVD Shrink batch processing
Offizieller Uebersetzer von DVD Shrink deutsch
pcolmer
Posts: 21
Joined: Sun Apr 19, 2015 6:24 pm

Re: Forced subtitles - flag not being set in MKV file?

Post by pcolmer »

I've just done some testing with another Blu-ray - Mission Impossible: Ghost Protocol.

This disc has three English subtitle tracks, the third of which is the forced subtitles track. Unlike The Avengers, the forced subtitles track on MIGP does have the forced attribute on each subtitle.

There are two interesting observations to be made as a result of ripping this disc with MakeMKV:
  1. MakeMKV creates a 100% duplicate copy of that third subtitle track.

    It may be more useful if MakeMKV only created a separate "forced only" subtitles track if the subtitle track in question had some forced subtitles but not all. That may require an extra pass through the m2ts file, admittedly, and maybe there should be an option for that. Admittedly it may only save a small amount of space but it would reduce the number of subtitle tracks being offered upon playback and therefore potentially reduce confusion.
  2. The corresponding track in the MKV files does not have the "forced subtitles" flag set on the track itself.

    I think this would be a big improvement to have, particularly for users of Kodi and similar players that try to handle forced subtitles. The problem, as I understand it, with the implementation in Kodi is that it only considers subtitles to be forced if the track is marked as forced and not the individual subtitles. I guess that this is to avoid the need to scan each subtitle track in turn looking for the forced attribute. It would also help to reduce the confusion that a lot of Kodi users appear to have when they rip a Blu-ray with MakeMKV, knowing that the disc has forced subtitles and yet the subtitles don't appear in Kodi.
Maybe these could be added in a future version of MakeMKV.
Chetwood
Posts: 976
Joined: Mon Aug 30, 2010 9:16 am

Re: Forced subtitles - flag not being set in MKV file?

Post by Chetwood »

pcolmer wrote: MakeMKV creates a 100% duplicate copy of that third subtitle track.

It may be more useful if MakeMKV only created a separate "forced only" subtitles track if the subtitle track in question had some forced subtitles but not all.
I don't get it. Do you mean, the forced track is muxed twice into the MKV? I think I have seen this before.
pcolmer wrote:The corresponding track in the MKV files does not have the "forced subtitles" flag set on the track itself.
MMh, MakeMKV does it for me since, as mentioned above, I have setFirstForcedSubtitleTrackAsDefault="true" in the default.mmcp.xml.
pcolmer wrote:I guess that this is to avoid the need to scan each subtitle track in turn looking for the forced attribute.
To scan as in browse the entire track? I don't know how MPC-HC does it, but it shows forced subs automatically even if the items only and no the tracks are flagged.
MultiMakeMKV: MakeMKV batch processing (Win)
MultiShrink: DVD Shrink batch processing
Offizieller Uebersetzer von DVD Shrink deutsch
pcolmer
Posts: 21
Joined: Sun Apr 19, 2015 6:24 pm

Re: Forced subtitles - flag not being set in MKV file?

Post by pcolmer »

Chetwood wrote:Do you mean, the forced track is muxed twice into the MKV? I think I have seen this before.
Yes, that's what I mean. The MIGP Blu-ray has three subtitle tracks. The MKV created by MakeMKV has four subtitle tracks. #3 & #4 are identical.
Chetwood wrote:
pcolmer wrote:The corresponding track in the MKV files does not have the "forced subtitles" flag set on the track itself.
MMh, MakeMKV does it for me since, as mentioned above, I have setFirstForcedSubtitleTrackAsDefault="true" in the default.mmcp.xml.
I have that set as well. This doesn't set the "forced subtitles" flag in the track. What the name implies it should do is to set the "Default track" flag, but it isn't doing that either. I've checked all four subtitle tracks created by MakeMKV and none of them have the default track flag set.

Curiously, in my default.mmcp.xml file, I also have:

ignoreForcedSubtitlesFlag="true"

I'm not at all sure what this is supposed to mean!
Chetwood wrote:
pcolmer wrote:I guess that this is to avoid the need to scan each subtitle track in turn looking for the forced attribute.
To scan as in browse the entire track? I don't know how MPC-HC does it, but it shows forced subs automatically even if the items only and no the tracks are flagged.
I've double-checked the behaviour in Kodi and it only displays forced subs if the actual subtitle track has "Forced display" set. This is why I think it would be really helpful if MakeMKV set that flag on any tracks that only have forced subs in them.
pcolmer
Posts: 21
Joined: Sun Apr 19, 2015 6:24 pm

Re: Forced subtitles - flag not being set in MKV file?

Post by pcolmer »

pcolmer wrote:Curiously, in my default.mmcp.xml file, I also have:

ignoreForcedSubtitlesFlag="true"

I'm not at all sure what this is supposed to mean!
Setting that to "false" and re-doing the conversion results in my second request being fulfilled, namely that the forced subtitles track created by MakeMKV has the "forced display" flag set on the track!

Nice ... it would be even nicer if false was the default value :wink:
Post Reply