Compatibility issue from way that DAR is specified in MKV?

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
hypertonus
Posts: 2
Joined: Sat Apr 13, 2019 5:01 pm

Compatibility issue from way that DAR is specified in MKV?

Post by hypertonus » Sat Apr 13, 2019 5:27 pm

I am doing my video archiving in MKV since many years. I recently switched from StaxRip to Handbrake and noticed it gives me an issue in playing some files on my old AzBox, which I am using as a receiver & media player in the bedroom still. The issue appears on files with a PAR that is not 1:1.

I figured out that the issue seems to come from the way the DAR is sepcified in the MKV container. Handbrake seems to set this by multiplying the numerators and denominators of SAR & PAR. So e.g. for a movie that has 718x574 (cropped by 2 on x and y axis) and a PAR of 64/45 the resulting DAR in the MKV is (718x64):(574x45) = 22976:12915. The media player of my AzBox (Enigma) does not play this.

If I go and remux the MKV, specifying the DAR in the way that the Handbrake GUI also displays it on the Overview tab, then it will work:
(718x64/45):574 = 1021:45. There is of course a rounding involved here as 1021 is rounded from 1021,1555..

So is there a way to tell Handbrake to set the DAR for MKV in the way it is displyed on the Overview screen rather than by making the multiplcation of numerator and denominator in order to save me having to run all videos through another remuxing operation in order to keep compatibility? I checked all the command line options and found nothing referring to that (and for sure using non-anamorph conversion is no option, of course).

rollin_eng
Veteran User
Posts: 3146
Joined: Wed May 04, 2011 11:06 pm

Re: Compatibility issue from way that DAR is specified in MKV?

Post by rollin_eng » Sat Apr 13, 2019 5:53 pm

Could you please post your HB logs, instructions can be found here:

https://handbrake.fr/docs/en/latest/hel ... y-log.html

mduell
Veteran User
Posts: 6630
Joined: Sat Apr 21, 2007 8:54 pm

Re: Compatibility issue from way that DAR is specified in MKV?

Post by mduell » Sat Apr 13, 2019 6:06 pm

This is very much not a general question, as it relates to a specific encode.

Also, this is sort of par for the course if you choose MKV. It's not a real standard, just a collection of implementations doing whatever and you can't really say they're wrong.

User avatar
JohnAStebbins
HandBrake Team
Posts: 5441
Joined: Sat Feb 09, 2008 7:21 pm

Re: Compatibility issue from way that DAR is specified in MKV?

Post by JohnAStebbins » Sat Apr 13, 2019 6:40 pm

Sounds like a bug in AzBox. matroska supports DAR rational with large numerator and denominator, up to 64 bits. The spec does not limit the range in any way.

HandBrake doesn't have any direct control over what is written here. We supply resolution and PAR to libavformat and it computes and writes the DAR. We could conceivably tweak PAR ahead to force the DAR computation to some range, but that's fugly.

hypertonus
Posts: 2
Joined: Sat Apr 13, 2019 5:01 pm

Re: Compatibility issue from way that DAR is specified in MKV?

Post by hypertonus » Tue Apr 16, 2019 6:10 pm

For sure it is an issue in the OpenRSI media player (or the AzBox implementation of it). Not necessarily a fault in there, just an 8 years old system, so we are speaking about legacy compatibility. I was just wondering about the possibility to get it written to MKV as it is done in StaxRip, where the DAR was written in a compatible way (I think as a command line parameter to mkvtoolnix). So I do understand that in Handbrake it is beyond influence, as libavformat handles the calculation. That is the answer to my question, thanks for that.
I'll then do the remuxing via mkvtoolnix for those movies that require it (mostly old 4:3 stuff). Not so many and becoming less over time anyway.

Post Reply