MediaArea / MediaConch

MediaConch (funded by PREFORMA)
29 stars 11 forks source link

video files that once passed policy now fail policy? #223

Open genfhk opened 3 years ago

genfhk commented 3 years ago

Curious issue where MC seems to be failing MKVs but I can't exactly pinpoint why... Not the most helpful issue, I know, but I can send policy and sample files via email which would be more useful.

Screen Shot 2020-12-23 at 12 43 39 PM

vs.

Screen Shot 2020-12-23 at 12 44 14 PM
dericed commented 3 years ago

can you share the output of mediaconch -mt failfailfail.mkv and your policy

genfhk commented 3 years ago

https://drive.google.com/drive/folders/1LaQdx2_JoDK7L-eFDmY69pMcVfzxNTWi?usp=sharing

dericed commented 3 years ago

Seems like a bug in the conditional logic. The xml of the policy result is at https://gist.github.com/dericed/bee9a592c9a5b96803770e6279902a7d.

https://gist.github.com/dericed/bee9a592c9a5b96803770e6279902a7d#file-ghk-xml-L27-L31

<policy name="Pixel Aspect Ratio is D1?" type="or" rules_run="3" fail_count="1" pass_count="2" outcome="fail">
  <rule name="NTSC D1?" value="PixelAspectRatio" tracktype="Video" occurrence="*" operator="=" xpath="mi:MediaInfo/mi:track[@type='Video'][*]/mi:PixelAspectRatio='0.900'" outcome="pass"/>
  <rule name="PAL D1?" value="PixelAspectRatio" tracktype="Video" occurrence="*" operator="=" xpath="mi:MediaInfo/mi:track[@type='Video'][*]/mi:PixelAspectRatio='1.067'" actual="0.900" outcome="fail"/>
  <rule name="FFV1 is encoded in GOP size of 1?" value="Format_Settings_GOP" tracktype="Video" occurrence="*" operator="=" xpath="mi:MediaInfo/mi:track[@type='Video'][*]/mi:Format_Settings_GOP='N=1'" outcome="pass"/>
</policy>

This is an 'or' policy with 2 passing rules and a failing rules, but the whole policy fails.

At https://gist.github.com/dericed/bee9a592c9a5b96803770e6279902a7d#file-ghk-xml-L53-L56

<policy name="Video Sample Range clarified?" type="or" rules_run="2" fail_count="0" pass_count="2" outcome="fail">
  <rule name="Range data is stored?" scope="mmt" value="Segment/Tracks/TrackEntry/Video/Colour/Range/" occurrence="*" xpath="mmt:MicroMediaTrace/mmt:b[@n='Segment']/mmt:b[@n='Tracks']/mmt:b[@n='TrackEntry']/mmt:b[@n='Video']/mmt:b[@n='Colour']/mmt:b[@n='Range']" outcome="pass"/>
  <rule name="Range data is not Unspecified?" scope="mmt" value="Segment/Tracks/TrackEntry/Video/Colour/Range/Data" occurrence="*" operator="!=" xpath="mmt:MicroMediaTrace/mmt:b[@n='Segment']/mmt:b[@n='Tracks']/mmt:b[@n='TrackEntry']/mmt:b[@n='Video']/mmt:b[@n='Colour']/mmt:b[@n='Range']/mmt:d!='o2'" outcome="pass"/>
</policy>

all the rules of the policy pass but the policy itself fails. :-/

g-maxime commented 3 years ago

type='or' refers to an exclusive or.

<aliasxsl:when test="$type = 'or' and $pass_count = 1">pass</aliasxsl:when> (I can't find the original xsl in the sources tree.)

Maybe add more precise nor/xor options and keep current 'or' behaviour for compatibility .

JeromeMartinez commented 3 years ago

thanks @g-maxime for the catch. So the workaround is to have a rule which is also false, and we fix the the 'or' (IMO no need to keep compatibility, the only known usage is e.g. DAR is 4:3 or 16:9 so "or" or "xor" have same result).

g-maxime commented 1 year ago

Fixed by MediaArea/MediaConch_SourceCode#692 closing?