MediaArea / MediaConch

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

Mediaconch V22.09 'or' policy failures on Ubuntu 22.04.1 LTS #233

Closed digitensions closed 1 year ago

digitensions commented 1 year ago

Hi there,

Installed the splendid MediaConch to a new server this week, with Ubuntu 22.04.1 LTS. I'm running batch MP4 transcoding scripts for access copies across several servers, and have earlier installations of this software working fine on Ubuntu 20.04 (version 18). Both the new and old versions are using the same policy, pasted at the bottom of this issue.

The installations for this server for MediaConch (first use of mediaconch-server): libmediaconch0_22.09-1_amd64.xubuntu_22.04.deb libzen0v5_0.4.39-1_amd64.xUbuntu_22.04.deb mediaconch_22.09-1_amd64.xUbuntu_22.04.deb mediaconch-server_22.09-1_amd64.xUbuntu_22.04.deb

The MP4 files are FFmpeg encoded from varying preservation masters using similar FFmpeg command to this: ffmpeg -i <infile> -map 0:v:0 -map 0:a? -disposition:a:1 default -dn -c:v libx264 -crf 28 -pix_fmt yuv420p -movflags faststart -vf yadif,crop=704:572:8:2,scale=1024:576:flags=lanczos -nosdin -y <outfile> -f null -

The policy is returned 'failed!' and listing items from the sections of 'or' policy that do not match the file, but not returning the ones that do match. Feels like a failure to notice it's 'or' and not 'and'. This doesn't fail in V18 MediaConch tests run against the same files in parallel. They pass fine.

I've also noticed some problems with mediainfo v22 reading MP4 files on Ubuntu 20.04, can give more info on MediaInfo issue tracker if needed and not linked.

Happy to supply and more additional data.

Many thanks! Joanna

<?xml version="1.0"?>
<policy type="and" name="MP4 access transcoding checks" license="MIT">
  <description>Test that the MP4 transcode is configured as expected.
  - Correct extensions, codecs, formats, pixel aspect ratio, height/width.
  - Audio ignored as may not be present in some cases.</description>
  <rule name="General/VideoCount is 1" value="VideoCount" tracktype="General" occurrence="*" operator="=">1</rule>
  <rule name="General/FileExtension is mp4" value="FileExtension" tracktype="General" occurrence="*" operator="=">mp4</rule>
  <rule name="General/Format is MPEG-4" value="Format" tracktype="General" occurrence="*" operator="=">MPEG-4</rule>
  <rule name="General/IsStreamable is Yes" value="IsStreamable" tracktype="General" occurrence="*" operator="=">Yes</rule>
  <rule name="Video/Format is AVC" value="Format" tracktype="Video" occurrence="*" operator="=">AVC</rule>
  <rule name="Video/Format_Profile is High" value="Format_Profile" tracktype="Video" occurrence="*" operator="=">High</rule>
  <rule name="Video/Rotation is 0.000" value="Rotation" tracktype="Video" occurrence="*" operator="=">0.000</rule>
  <rule name="Video/FrameRate_Mode is CFR" value="FrameRate_Mode" tracktype="Video" occurrence="*" operator="=">CFR</rule>
  <rule name="Video/ColorSpace is YUV" value="ColorSpace" tracktype="Video" occurrence="*" operator="=">YUV</rule>
  <rule name="Video/ChromaSubsampling is 4:2:0" value="ChromaSubsampling" tracktype="Video" occurrence="*" operator="=">4:2:0</rule>
  <rule name="Video/ScanType is Progressive" value="ScanType" tracktype="Video" occurrence="*" operator="=">Progressive</rule>
  <rule name="Duration field exists" value="Duration" tracktype="Video" occurrence="*"/>
  <policy type="or" name="Width is 640, 704, 720, 768, 1024, 1280 or 1920">
    <rule name="Video/Width is 1920" value="Width" tracktype="Video" occurrence="*" operator="=">1920</rule>
    <rule name="Video/Width is 1280" value="Width" tracktype="Video" occurrence="*" operator="=">1280</rule>
    <rule name="Video/Width is 1024" value="Width" tracktype="Video" occurrence="*" operator="=">1024</rule>
    <rule name="Video/Width is 768" value="Width" tracktype="Video" occurrence="*" operator="=">768</rule>
    <rule name="Video/Width is 720" value="Width" tracktype="Video" occurrence="*" operator="=">720</rule>
    <rule name="Video/Width is 704" value="Width" tracktype="Video" occurrence="*" operator="=">704</rule>
    <rule name="Video/Width is 640" value="Width" tracktype="Video" occurrence="*" operator="=">640</rule>
  </policy>
  <policy type="or" name="Height is 480, 486, 576, 720 or 1080">
    <rule name="Video/Height is 1080" value="Height" tracktype="Video" occurrence="*" operator="=">1080</rule>
    <rule name="Video/Height is 720" value="Height" tracktype="Video" occurrence="*" operator="=">720</rule>
    <rule name="Video/Height is 576" value="Height" tracktype="Video" occurrence="*" operator="=">576</rule>
    <rule name="Video/Height is 486" value="Height" tracktype="Video" occurrence="*" operator="=">486</rule>
    <rule name="Video/Height is 480" value="Height" tracktype="Video" occurrence="*" operator="=">480</rule>
  </policy>
  <policy type="or" name="Bit depth 8 or 10 bits">
    <rule name="Video/BitDepth is 8" value="BitDepth" tracktype="Video" occurrence="*" operator="=">8</rule>
    <rule name="Video/BitDepth is 10" value="BitDepth" tracktype="Video" occurrence="*" operator="=">10</rule>
  </policy>
</policy>
digitensions commented 1 year ago

Looks similar to issue #223

g-maxime commented 1 year ago

Can you provide the output report when trying to apply the policy? mediaconch -f -fx -pv 1 -p <policyfile> <mp4file>

digitensions commented 1 year ago

Thanks, here you go!

mediaconch_output.txt

digitensions commented 1 year ago

Ah I forgot to add the extension back on to the file before I checked, so pls ignore the extension fail. The policy checks the file prior to renaming without extension. Many thanks!!

g-maxime commented 1 year ago

I guess the problem is that the ""Duration field exists"" test fails? You can modify the line this way: <rule name="Duration field exists" value="Duration" tracktype="Video" occurrence="*" operator="exists"/>

But I will make a patch to also support the current syntax.

digitensions commented 1 year ago

Thanks. I don't recall now if this error was present before but certainly the MP4 example I have used has passed MediaConch tests from V18. Appreciate your help. I can make that amendment to the policy and test to see if that's the fix quickly.

digitensions commented 1 year ago

That fixed it, thank you! My mistake to have the 'exists' missing. Don't worry about a patch!

JeromeMartinez commented 1 year ago

I have used has passed MediaConch tests from V18

It may have worked previously due to an unspecified default value for operator attribute and it default value have changed with one update. @g-maxime is it easy to consider default value for operator attribute exists?

digitensions commented 1 year ago

A note for any onlookers, the change means that the pass statement is still returning a 'pass!' first, but then lists all the 'or' statement fails afterward which might impact how your automated processes read/understand the outcome.

Eg, pass! N_123456_01of01.mpv -- [pass: MP4 access transcoding checks] -- [fail:Video/Width is 1280] -- [fail:Video/Width is 1024] -- [fail:Video/Width is 768] -- [fail:Video/Width is 720] ....

JeromeMartinez commented 1 year ago

My mistake to have the 'exists' missing. Don't worry about a patch!

This is a regression, so fixed.