Log in

View Full Version : h264 video not Blu-ray compatible after mkvmerge?


qtip2k
19th June 2012, 15:46
Hi!

I have a strange problem with tsMuxer, mkvmerge and Blu-ray video.

Procedure:
1. Demux Blu-ray content with eac3to or tsMuxer
2. Mux video and audio in mkvmerge to .mkv (mkv plays fine after that)
3. Open .mkv in tsMuxer and remux to Blu-ray.

Result: The video studders on two different standalone Blu-ray players, is not shown at all or looks like played with 10fps.

If I remux the m2ts from the original Blu-ray in tsMuxer directly everything plays fine.
If I demux the mkv with mkvextract or eac3to and open the streams in tsMuxer the result is the same as when I directly use the mkv - the video studders.
tsMuxer recognizes the correct fps-rate, so that's not the problem.

Sure, I could use the source directly, but sometimes, I don't have the source anymore. I think this is very strange. It looks like mkvmerge changes the video-stream in some way.

Does anyone know about this and what the problem is?

SquallMX
21st June 2012, 03:29
That is a know issue.

If I remember correctly the MKV file format removes/edits some metadata needed for proper playback on standalones, the recommendation is always using RAW (.264) streams or TS/M2TS. Try unchecking both "Add picture timing info" and "Continually insert SPS/PPS". Sometimes can fix the problem in some players...

Edit from Videohelp guide "Encoding SD video with H.264 to be 100% Blu-ray compliant.":

Multiplexing/demultiplexing a stream through MP4/MKV will delete vital data such as IDK, delimiters, HRD, SPS, etc, necessary for blu-ray compatibility, particularly any calculations/data pertinent at the container level.

qtip2k
22nd June 2012, 12:23
Thanks for clearing things up!
Unchecking "Add picture timing info" and "Continually insert SPS/PPS" didn't help but at least now I know the reason why this doesn't work...

Ghitulescu
22nd June 2012, 15:58
I fail to understand how unchecking those checkboxes could render the stream blu-ray compatible.

They are there to [en]force the blu-ray compatibility.

I never had muxing troubles of this kind (but I had others) with tsmuxer.

SquallMX
23rd June 2012, 01:16
I fail to understand how unchecking those checkboxes could render the stream blu-ray compatible.

They don't, but for some weird reasons some players will correctly play the resulting stream :confused:.

qtip2k
23rd June 2012, 12:19
The strange thing about this is, that some Blu-ray -> mkv -> Blu-ray remuxes play fine, others not at all. Is there some setting in mkvmerge that prevents the stream from being changed?
Also: Is there a way to reinsert the lost information into the h264 stream without reencoding the video?

iSeries
23rd June 2012, 13:34
The strange thing about this is, that some Blu-ray -> mkv -> Blu-ray remuxes play fine, others not at all. Is there some setting in mkvmerge that prevents the stream from being changed?
Also: Is there a way to reinsert the lost information into the h264 stream without reencoding the video?

There are no settings to change in mkvMerge that will preserve this data. I'm pretty sure as well that there is no way to recover this information. You can re-encode using x264 obviously but you may not want to do this.

Not all players are this strict though, what's your player? I have 2 LG's and a Sony and all play mkv's remuxed to blu ray just fine.

You might want to avoid mkv in the future and just keep it in it's original structure (or a movie-only remux with tsMuxer). I'm a bit confused by your statement 'but sometimes, I don't have the source anymore' though....

frank
2nd July 2012, 15:52
If you used MKVmerge then check if the header compression is switched off (Setting options of MKVmerge GUI)

Then tsMuxeR can create the BD.
With this useless mkv header compression (only 0.01 % compression on HD) tsMuxeR will crash.

Or: demux the mkv into elementary streams and then remux with tsMuxeR

Video Dude
3rd July 2012, 02:25
There are no settings to change in mkvMerge that will preserve this data. I'm pretty sure as well that there is no way to recover this information. You can re-encode using x264 obviously but you may not want to do this.


Why does mkvmerge remove that data?

deank
4th July 2012, 16:59
Why does mkvmerge remove that data?

To save space. It is not actually 'removing' it, but it uses the first header information and since the info is not changed throughout the video duration - it is skipped (or changed to occupy less space/bytes per packet). Some players understand that and use the 1st header info, other players expect it to be present all the time.

frank
7th July 2012, 16:24
...changed to occupy less space/bytes per packet
And that's the point. It is not the job of any muxer to manipulate packets!
(Matroska was designed at times of divx and low speed internet. Every advantage in compression was important, only PC in focus and no other standards.)

I'm surprised that no one has recompiled mkvtoolnix without that issue.

Chetwood
8th July 2012, 06:22
Probably because they simply turned of header compression under options?

Video Dude
26th July 2012, 17:52
I was looking for an alternative to mkv because of the muxing issue and I recently started using tsmuxer to mux my h.264 videos to m2ts. m2ts is supported by my media player and bluray player and it does not change the video stream. I demuxed the video stream and compared in a hex editor and found the stream is 1:1 to the original raw stream prior to mux.

quartex
5th August 2012, 10:17
I'm experiencing a similar issue
Some time ago I hired a professional photographer to make some videos for my son first communion.
He gave me a hard disk containing some high definition mkv. They played fine both with TMT5 and VLC.
Then I decided to convert these mkv to Blu-Ray structure using tsmuxer and again they played fine both with TMT5 and VLC.
Recently I buyed an oppo 93 standalone player and I discovered that they play with some slight video stutters always at same points.
I tried to demux Blu-Ray structure with eac3to into elementary streams and then remux again with tsMuxeR but no luck. The stutter happens repeatably at the same points.
But if I demux from original mkv using eac3to and then remux again with tsMuxeR to Blu-Ray structure, video is then perfect with no stutters.
Is there a way I can make these blu-ray compatible with my standalone player without re-encoding them?

I also tried to open the mkv with mkvmerge 5.7 and under extra tab compression is not selected. Is there a way to know if header compression was used or not?

adding:
using mkvinfo I don't see any info related to 'content encodings' so it seems no compression was used. In this case why mkv to Blu-ray with tsmuxer cause stuttering on standalone player?

sneaker_ger
5th August 2012, 13:27
Header removal compression shouldn't be the cause of this, because it should be reconstructed on demux. It just makes tsmuxer fail (error out or crash, don't remember from the top of my head). SquallMX gave a pointer as to which information are altered when muxed to mkv.

But if I demux from original mkv using eac3to and then remux again with tsMuxeR to Blu-Ray structure, video is then perfect with no stutters.
Is there a way I can make these blu-ray compatible with my standalone player without re-encoding them?

First you say you've made it work, then you ask how to make it work? :confused:

Chances are the data in the mkvs is not 100% Blu-Ray-Compatible anyways, as certain rules need to be followed. There's a sticky explaining those in the AVC forum.

quartex
5th August 2012, 14:27
Header removal compression shouldn't be the cause of this, because it should be reconstructed on demux. It just makes tsmuxer fail (error out or crash, don't remember from the top of my head). SquallMX gave a pointer as to which information are altered when muxed to mkv.


First you say you've made it work, then you ask how to make it work? :confused:




Unfortunately I was not smart enough to keep all the original mkv files. I was lucky enough to recover some of them from a partial copy I did for my brother.



Chances are the data in the mkvs is not 100% Blu-Ray-Compatible anyways, as certain rules need to be followed. There's a sticky explaining those in the AVC forum.


When selecting Blu-ray disk output, does tsmuxer implicitly demux mkv into elementary streams before remuxing?
If yes, since eac3to demux prevent stuttering, what's the difference between eac3to and tsmuxer when demuxing mkv?

Eseninzhiv
6th August 2012, 22:43
Result: The video studders on two different standalone Blu-ray players, is not shown at all or looks like played with 10fps.

If I remux the m2ts from the original Blu-ray in tsMuxer directly everything plays fine.
If I demux the mkv with mkvextract or eac3to and open the streams in tsMuxer the result is the same as when I directly use the mkv - the video studders.
tsMuxer recognizes the correct fps-rate, so that's not the problem.

Sure, I could use the source directly, but sometimes, I don't have the source anymore. I think this is very strange. It looks like mkvmerge changes the video-stream in some way.

Does anyone know about this and what the problem is?

try to disable these options (2)

http://t.imgbox.com/acpWFGkl.jpg (http://imgbox.com/acpWFGkl)

http://t.imgbox.com/abia7eqd.jpg (http://imgbox.com/abia7eqd)

Ghitulescu
7th August 2012, 10:41
He gave me a hard disk containing some high definition mkv. They played fine both with TMT5 and VLC.
Then I decided to convert these mkv to Blu-Ray structure using tsmuxer and again they played fine both with TMT5 and VLC.
Recently I bought an oppo 93 standalone player and I discovered that they play with some slight video stutters always at same points.
I tried to demux Blu-Ray structure with eac3to into elementary streams and then remux again with tsMuxeR but no luck. The stutter happens repeatably at the same points.
But if I demux from original mkv using eac3to and then remux again with tsMuxeR to Blu-Ray structure, video is then perfect with no stutters.
Is there a way I can make these blu-ray compatible with my standalone player without re-encoding them?

In this case why mkv to Blu-ray with tsmuxer cause stuttering on standalone player?

I understand the words but not the message :confused:
Where did you have the reencoding? None of the aforementioned tools reencodes the video....
Why did you say it's stuttering when you specifically mention that it doesn't?
Why don't you use eac3to to demux and tsmuxer to remux, if this is the winning alternative?

quartex
14th August 2012, 00:23
I understand the words but not the message :confused:
Where did you have the reencoding? None of the aforementioned tools reencodes the video....



I know. Like said I didn't keep all the original mkv so for some of these videos I have only the Blu Ray structure that is stuttering on standalone player.


Why did you say it's stuttering when you specifically mention that it doesn't?


It's not stuttering when eac3to is used to demux video before remuxing with tsmuxer. But I discovered this too late



Why don't you use eac3to to demux and tsmuxer to remux, if this is the winning alternative?

Sure! For the future I will use this combo.
Then I was curious to know why eac3to and tsmuxer acts differently with these mkv. If anyone knows...

Ghitulescu
14th August 2012, 08:42
Then I was curious to know why eac3to and tsmuxer acts differently with these mkv. If anyone knows...

I don't know and since I am not using MKV I never inquired.

However, I believe it's best to use the appropriate tools for each container. In this case, I think MKV-related tools (mkvtoolnix etc.) are the best for MKV, and not TS tools (designed for TransportStreams).

quartex
5th January 2013, 13:13
I also noticed that:
extracting video from mkv using mkvtoolnix and then muxing it using tsmuxer -> stuttering in standalone player and sometimes no video at all, only audio

Looks like only eac3to is able to demux the video from mkv without stuttering issue.