MakeMKV is changing the subtitle streams while muxing!

Everything related to MakeMKV
Post Reply
samtoy
Posts: 42
Joined: Sat Nov 19, 2011 7:05 pm

MakeMKV is changing the subtitle streams while muxing!

Post by samtoy »

Hallo, I just noticed something very strange:

- Source: BD Movie-only (Folder on HDD)
- Now I create a MKV from that movie using MakeMKV.
- Now I extract the subtitle from the Original Movie / BD Folder (using TSMuxer).
- Then I extract the same subtitle from the newly created MKV (using MKVToolnix + MKVExtractGUI2).

Now when I do a binary comparison of those 2 subtitle files they are *not* identical!! The filesize is exactly the same but not the contents. There are like 4000 binary differences! :shock:

That means that MakeMKV is altering the PGS subtitle files when muxing and a 100% identical reconstruction of an BD structure is not possible anymore.

Why is that? This does not happen with audiotracks, I checked it. It's just the subtitle streams that are changed. I always thought MakeMKV is *not* altering the original streams in any way (which makes the format so interesting to me in the first place)... :(

Is there an explanation or is this maybe a bug?

Cheers, S.
setarip_old
Posts: 2136
Joined: Wed Dec 09, 2009 1:31 pm

Re: MakeMKV is changing the subtitle streams while muxing!

Post by setarip_old »

Hi!
- Now I extract the subtitle from the Original Movie / BD Folder (using TSMuxer).
- Then I extract the same subtitle from the newly created MKV (using MKVToolnix + MKVExtractGUI2).

That means that MakeMKV is altering the PGS subtitle files when muxing and a 100% identical reconstruction of an BD structure is not possible anymore.
This is not necessarily so. You've used two different tool sets (out of necessity) to extract the subtitle stream from the .M2TS file and the .MKV. If there actually has been a change, it may be that one or both of the extraction tool sets (tsMuxer or MKVExtractGUI2/MKVToolnix) has made some kind of change.

However, it seems odd that, as you say, although the stream size remains identical, there are approximately 4,000 binary differences.

1) What tool did you use for making this binary comparison?

2) Have you compared the visual displays of the subtitles to see if there are any obvious differences?

3) Have you used a hex editor to try to determine the SPECIFIC nature of the differences? - Perhaps they are innocuous differences in repeated header or sector information. It's a bit hard to believe that there were any meaningful changes while the total filesize remained EXACTLY the same...


samtoy
Posts: 42
Joined: Sat Nov 19, 2011 7:05 pm

Re: MakeMKV is changing the subtitle streams while muxing!

Post by samtoy »

Thanks for your reply.

1) I'm using Total Commander's built-in binary compare tool. I've been using it for years.

2) Yes I have. I opened both sub files in BDSup2Sub and there was absolutely no corruption or problem to see. They both seem ok.

3) No and I'm afraid that's a bit over my head. But it would make sense that it's some repeated header information that gets changed. But why??

Both sub files have the correct size of 13.645.690 bytes but the one from the MKV has 4796 differences.

I also would like to extract the subtitle from the MKV with TSMuxer (just to be sure) but it won't work. TSMuxer does not recognize PGS subs in MKV files. And MKVExtract won't allow me to extract streams from an m2ts file. Is there a tool which can do PGS extraction from both file formats?

BTW: I also checked this behaviour with another movie with exactly the same outcome.
robpdotcom
Posts: 86
Joined: Thu Nov 11, 2010 5:58 pm

Re: MakeMKV is changing the subtitle streams while muxing!

Post by robpdotcom »

eac3to might be able to extract the streams from both files.
samtoy
Posts: 42
Joined: Sat Nov 19, 2011 7:05 pm

Re: MakeMKV is changing the subtitle streams while muxing!

Post by samtoy »

OK, I now checked with eac3to on both files (m2ts and mkv):

Exactly the same behaviour -> same filesize, app. 4000 binary differences! So it's not a problem of the used extraction tool.

The original PGS subtitle file is definately changed when muxed into the MKV file.

Does somebody have an explanation for this? Is this normal maybe (some MKV rule)?
robpdotcom
Posts: 86
Joined: Thu Nov 11, 2010 5:58 pm

Re: MakeMKV is changing the subtitle streams while muxing!

Post by robpdotcom »

Do subs muxed with MKVmerge show the same differences?
samtoy
Posts: 42
Joined: Sat Nov 19, 2011 7:05 pm

Re: MakeMKV is changing the subtitle streams while muxing!

Post by samtoy »

When I get home I will check with MKVMerge (from MKVToolNix 5.0.1) and report back. I will also try another movie after that just to make sure.

Maybe someone else can check too? Just create a MKV from a BD movie, extract the same PGS subs from both versions and do a binary comparison. Would be interesting to know.
samtoy
Posts: 42
Joined: Sat Nov 19, 2011 7:05 pm

Re: MakeMKV is changing the subtitle streams while muxing!

Post by samtoy »

OK, finished checking:

- New BD movie, made the MKV straight from the m2ts with MKVMerge (MKVToolnix 5.0.1).
- Extracted the PGS subs from both files using eac3to.

Same outcome -> PGS files are identical in size but not in content (thousands of differences)!

This proves that muxing PGS subs into a MKV file irreversably changes the original subtitle stream.

Not too cool for a strict "container" format like MKV, right? :wink:
setarip_old
Posts: 2136
Joined: Wed Dec 09, 2009 1:31 pm

Re: MakeMKV is changing the subtitle streams while muxing!

Post by setarip_old »

@samtoy

Hopefully, "mike admin" will come along to provide an explanation.

In the meanwhile, based on your two observations that:

1) Subpic filesizes are IDENTICAL
2) There are no obvious visual differences between the the character images in both versions,

My instinct tells me that the differences are harmless and likely have nothing to do with the individual characters...

mike admin
Posts: 4065
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: MakeMKV is changing the subtitle streams while muxing!

Post by mike admin »

This is a specific case with PGS format. When muxed in M2TS each PGS subtitle frame is split into multiple sub-frames. Each sub-frame has two times associated with it - a time when it should be displayed and a time when the frame should be present in M2TS file. So for a single frame you typically get 10 timecodes stored in PGS file, while in practice you only need one - when to display a frame. When put in MKV container, only subtitle data is stored, but not timecodes - as MKV container provides it's own timecode management. If you extract PGS subtitle from MKV to PGS file, mkvtoolnix would put timecodes from MKV into PGS headers.

Pretty much every tool ignores these excessive timecodes. These are the differences that you see. The actual subtitle data should be identical. Timecodes might be different for a few milliseconds, as MakeMKV always adjust subtitle timecodes so they match closest video frame. You won't be able to notice it though.

Bottom line - MakeMKV is not corrupting subtitle streams.
samtoy
Posts: 42
Joined: Sat Nov 19, 2011 7:05 pm

Re: MakeMKV is changing the subtitle streams while muxing!

Post by samtoy »

I see, thanks alot for all the info.

I also contacted the author of MKVToolnix and he told me something similar.

@mike admin:

But does that mean that when muxing PGS subs from a MKV file *back* into a M2TS/Blu-ray container the subs won't work anymore because those timecodes are now missing? Or will they be newly created by the muxing program (TSMuxeR)?
mike admin
Posts: 4065
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: MakeMKV is changing the subtitle streams while muxing!

Post by mike admin »

samtoy wrote:I see, thanks alot for all the info.

I also contacted the author of MKVToolnix and he told me something similar.

@mike admin:

But does that mean that when muxing PGS subs from a MKV file *back* into a M2TS/Blu-ray container the subs won't work anymore because those timecodes are now missing? Or will they be newly created by the muxing program (TSMuxeR)?
That depends on a muxing program. To my best knowledge, TSMuxer will mux these streams properly, even with missing DTS timecodes.
Post Reply