View Full Version : HEVC in MKV
pieter3d
30th October 2013, 20:51
Is there an official way to put HEVC streams in a Matroska container yet? If so, who decides what is considered official, and is there a spec?
filler56789
30th October 2013, 21:04
Is there an official way to put HEVC streams in a Matroska container yet?
According to this post by JEEB (http://forum.doom9.org/showthread.php?p=1649525#post1649525), now there is. :)
Now all that we need is an implementation :sly:
JEEB
30th October 2013, 21:25
Since it is pretty much 14496-15 3rd ed in Matroska, implementing it demuxer-wise was very simple. As for muxer, there's the Rovi fork of mkvtoolnix (https://github.com/jaya-divx/mkvtoolnix) which they implemented HEVC muxing and demuxing with. At first it used their own AVCc plus VPS thing, but matroska-devel pretty much noted that it'd be better to only have one type of extradata around. Not sure if anyone keeps up-to-date builds of this code, and older versions one should generally stay away from as they use an incompatible extradata format.
I have not done much review of the DivX code, but I keep a fork (https://github.com/jeeb/mkvtoolnix/tree/hevc_support) of mkvtoolnix around that has the HEVC changes on top of current mkvtoolnix head. It seems to generally "work".
pieter3d
30th October 2013, 21:36
Ok, but "someone's fork of mkvtoolnix" doesn't really count as an official way to do this.
JEEB
30th October 2013, 21:49
Yes, the actual way to mux/demux is settled upon (see what the person before linked (http://forum.doom9.org/showthread.php?p=1649525#post1649525), which then links towards my write-up [probably the most proper'ish spec-like thing for muxing anything into Matroska so far, don't forget that AVC/H.264 never had any kind of documentation other than this (http://haali.su/mkv/codecs.pdf) regarding how to mux it] on HEVC-in-Matroska :P )
You can also see the next post or so where mosu indeed agrees that that is how it is going to be.
What I linked is just the currently available implementation meant for review and possible merge into mkvtoolnix. That's all. Geez.
Edit: Basically since filler56789 had already replied and linked my RFC/spec-like thing, my reply was towards the "Now all that we need is an implementation" part :P
pieter3d
30th October 2013, 21:56
OK, that does seem like a reasonable implementation that may be safe to assume.
Do the NALUs have the emulation prevention bytes (00 00 03 -> 00 00) removed or not?
VFR maniac
30th October 2013, 22:16
According to the __latest__ 14496-15, emulation prevention three bytes shall not be present.
ISO/IEC 14496-15;2010 Cor.2;2012 replaced EBSP with RBSP :P
But I think this is a typo, so as long as following 14496-15 we should store as EBSP i.e. with emulation prevention three bytes.
14496-15 uses EBSP for 9 years, so it is insane and brain-damaged to start storing as RBSP now.
The replacement is heavy breakage of compatibility.
I'll ask on Mp4-sys ML if the 3rd edition still has this replacement.
zion158
2nd November 2013, 01:00
Hello,
Recently I was trying to check the h.265 with 2160p
I familiar with “Ducks take off” a 2160p movie
so, at Divx Labs they have a new MKV tool. + Duck2160p.y4m(5.5GB)
I have decrees video file size from 2160p.264 at 500 MB to 2160p.265 at 80MB
Link to file: https://mega.co.nz/#!jcEWmRRC!Hn9qwnVXqn9ApuOhKaX-sUZNS2JvPTBzcRa9LGS33L0
General
Unique ID : 204632494113397553033899442588911414775 (0x99F2C8E8B3EE048AA51666B7F8702DF7)
Complete name : ...\Ducks.Take.Off.2160p.h.265-Zion.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 78.5 MiB
Duration : 20s 0ms
Overall bit rate : 32.9 Mbps
Encoded date : UTC 2013-10-20 00:32:36
Writing application : mkvmerge v6.2.0 ('Promised Land Rovi v1.0.4') built on Aug 29 2013 13:59:38
Writing library : libebml v1.3.0 + libmatroska v1.4.0
Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Codec ID : V_MPEGH/ISO/HEVC
Duration : 20s 0ms
Bit rate : 32.3 Mbps
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 fps
Bits/(Pixel*Frame) : 0.156
Stream size : 77.0 MiB (98%)
Default : Yes
Forced : No
As for the playing this file,
FFmpeg(beta), FFplay, can’t run properly at all.
(ffplay -strict -2 Ducks.Take.Off.2160p.h.265-Zion.mkv)
Potplayer 1.5.40953 Beta, barely run.
Divx 10 with HEVC plugin, barely run.
That’s all for now,
If you have any ideas about that I would like to hear.
Zion
filler56789
2nd November 2013, 01:14
so, at Divx Labs they have a new MKV tool
where is it?
EDIT:
mkvmerge v6.2.0 ('Promised Land Rovi v1.0.4') built on Aug 29 2013 13:59:38
That's not a new tool at all, and it can only produce INvalid Matroska files.
professor_desty_nova
2nd November 2013, 10:06
Tried the file with the latest non stable MPC-HC (LAV filters) and it died. I would guess 2160p is too much for most of the decoders right now. They need more optimizations and multithreading (if they don't have it already) to be able to handle more than 1080p. We can't forget that HEVC is supposed to be up to 3 times more compute intensive as H264 high profile. When h264 came out, it took a looong time until the computer I had was barely able to handle 720p in software (and I had to overclock it). And only hardware decoding (DVXA) permitted me to fully see 720p/1080p. Now that x265 is more usable, and the official HEVC in MKV is around the corner, I would guess we will see more pressure on optimizing the decoders.
nevcairiel
2nd November 2013, 11:06
2160p works nearly in realtime with LAV on my system (depending on the complexity of the sample). Note that the LAV built into MPC-HC is a bit older and doesn't have the latest version of the HEVC decoder yet.
professor_desty_nova
2nd November 2013, 13:42
2160p works nearly in realtime with LAV on my system (depending on the complexity of the sample). Note that the LAV built into MPC-HC is a bit older and doesn't have the latest version of the HEVC decoder yet.
I guess this time around most people with not very ancient computers will be able to use software decode right away (depending on the sample) :-)
Now it's just needed official MKVtoolnix support.
banker_rishad
16th August 2014, 05:18
try mpc-be
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.