Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI output includes inconsequential failures for "OR" policy rules #786

Open
bravoalphatango opened this issue Sep 25, 2024 · 6 comments
Open
Assignees

Comments

@bravoalphatango
Copy link

The CLI output for MediaConch seems to be mixing real and inconsequential failures for "OR" policy rules.

For example, I have a policy that can accept MKVs that are either NTSC or PAL with 2 channels of audio. My files are NTSC and all of them have 4 channels of audio expect for one. So all of my files will fail except for one but the rule they fail should not be the "OR" policy related to regional encoding. The audio channel rule should be the only rule that actually fails. This is represented in the GUI correctly:

Screenshot 2024-09-25 at 9 43 41 AM

However, when I use the CLI the output will list all of the PAL characteristics the files did not pass even though the file passes this rule. Here is a video and a screenshot:

(https://drive.google.com/file/d/1lmFjGJ8x15898yZJLCaw6izrhdBDYJaL/view?usp=sharing)

Screenshot 2024-09-25 at 9 43 16 AM

Here is the policy I am using.

Is there a way to work around this that I have overlooked? If not, is it possible to create a flag that abbreviates this output? It is not realistic to use the GUI with the volume of files we want to be QCing.

@JeromeMartinez
Copy link
Member

True that showing failed checks while it is a pass due to the upper "or" is not good and it is misleading.
For the moment there is no workaround, we need to change the behavior (removing failed checks which are not used).

@bravoalphatango
Copy link
Author

Is this a development that can happen? Being above to have this enhancement would change and greatly simplify how we write our policies in addition to simplifying our workflows.

@JeromeMartinez
Copy link
Member

Is this a development that can happen?

Yes, we are interested in that. Actually it is a collateral damage of a feature we implemented some time ago (different level of error: error/warning/info), before this development the behavior was the one you expect.
The question is more about when.
Currently this is a request in the free support tier (remind that the software is free to use, development is paid by the sponsoring of new requests) so there is no ETA at all, if you are interested in having a ETA, please contact us. We have different levels of services depending on the urgency of the request.

@g-maxime
Copy link
Contributor

g-maxime commented Sep 26, 2024

Can you share the xml output for a failing file?
mediaconch -f -fx -p <policy>.xml <file>.mkv

@bravoalphatango
Copy link
Author

@JeromeMartinez JeromeMartinez transferred this issue from MediaArea/MediaConch Sep 30, 2024
@dericed
Copy link
Contributor

dericed commented Dec 9, 2024

On can skip all inconsequential pass/fails by piping into xmlstarlet, such as:

mediaconch -f -fx -p <policy>.xml <file>.mkv | xmlstarlet edit -N "mc=https://mediaarea.net/mediaconch" -d "//*[@outcome='pass']"

For example with the file that @bravoalphatango linked to the output is:

xmlstarlet edit -N "mc=https://mediaarea.net/mediaconch" -d "//*[@outcome='pass']" JPC_AV_00534.mkv_MediaConchReport.xml

<?xml version="1.0" encoding="UTF-8"?>
<MediaConch xmlns="https://mediaarea.net/mediaconch" xmlns:mmt="https://mediaarea.net/micromediatrace" xmlns:mi="https://mediaarea.net/mediainfo" version="0.3" verbosity="0">
  <media ref="/Volumes/Buffy/D2-New/JPC_AV_00534.mkv">
    <policy name="AVMPI Policy - Masters" type="and" level="" rules_run="23" fail_count="1" warn_count="0" info_count="0" pass_count="22" outcome="fail">
      <tag/>
      <rule name="Audio/Channels is 2" value="Channels" tracktype="Audio" occurrence="*" operator="=" xpath="mi:MediaInfo/mi:track[@type='Audio'][*]/mi:Channels='2'" requested="2" actual="4" outcome="fail"/>
    </policy>
  </media>
</MediaConch>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants