Post subject: mkvtoolnix defect: h264 + 4:4:4
Editor, Emulator Coder, Site Developer
Joined: 5/11/2011
Posts: 1108
Location: Murka
If you create mkv files with the mkvtoolnix toolchain, that contain colorspaces other than 4:2:0 yuv (4:2:2, 4:4:4), and have dimensions that are not divisible by 16, these files will generally have container-level aspect ratio set to something other than what you want. In order to fix this, you must explicitly set parameters to mkvmerge
--display-dimension TID:wxh
There is little cause for concern; this affects a very small number of encodes, and the effect ranges from nothing on some players to a slightly incorrect AR on other players.
Lex
Joined: 6/25/2007
Posts: 732
Location: Vancouver, British Columbia, Canada
Can you post an example video file with this problem?
Editor, Emulator Coder, Site Developer
Joined: 5/11/2011
Posts: 1108
Location: Murka
http://www.mediafire.com/?wyg109apis3ahbt 160x161, 10 bit yuv 4:4:4 intended PAR: square pixels (1:1) intended DAR: 160:160 The circle and square should be exactly circle and exactly square; no oval or rectangle. actual PAR/DAR: varies by player Some programs will think this video has dimensions and or display dimensions of 160x146, because of braindead handling in mkvtoolnix. The fun part is, you can't actually make it "right", because the "video pixel size" information in the header will be wrong no matter what. Fortunately, most players seem to rely on the decoder for that information.
Lex
Joined: 6/25/2007
Posts: 732
Location: Vancouver, British Columbia, Canada
Is this what I should be seeing? This is what I see in MPC-HC using LAV Splitter, LAV Video Decoder, and madVR: Using an image editor, I checked the dimensions of the viewport there and they're 160×161.
Editor, Emulator Coder, Site Developer
Joined: 5/11/2011
Posts: 1108
Location: Murka
mpc-hc ignores all mkv container dimensions. this bug does not affect mpc-hc at all. i believe mplayer is the primary playing program that's affected by this.
Lex
Joined: 6/25/2007
Posts: 732
Location: Vancouver, British Columbia, Canada
I just tested with Haali splitter (since I use that for anime for its ordered chapter support) and the issue appears (assuming "Keep Aspect Ratio" is enabled) in MPC-HC. It seems LAV splitter doesn't care about the mkv header's dimensions, but Haali does.
Experienced player (764)
Joined: 6/17/2008
Posts: 146
Even if the DAR is correct, the MKV header will contain bonky values. While they may not be harmful, they look fugly and are just plain wrong. I'll post the proper workaround here for those who might have missed it:
mkvpropedit -e track:n -s pixel-width=n -s pixel-height=n -s display-width=n -s display_height=n bonk.mkv
Editor, Emulator Coder, Site Developer
Joined: 5/11/2011
Posts: 1108
Location: Murka
Problem has been fixed. Interim windows builds: http://www.bunkus.org/videotools/mkvtoolnix/win32/pre/ Build "411" or greater has the fix applied.
Lex
Joined: 6/25/2007
Posts: 732
Location: Vancouver, British Columbia, Canada
Excellent. :) Thank you for following this.