Closed joe-sciame-wm closed 4 months ago
Because we aren't able to compare different tracks' values, we ended up making sure that the video was the first stream, but we are worried this may be too restrictive across all the formats.
With first video StreamOrder
== 0
, right?
If you want to catch e.g. also content with time code first, you may add "or (first video StreamOrder
== 1
&& first audio StreamOrder
== 2
)".
Thoughts on a capability to be able to compare two values across tracks?
If I understand correctly, the idea is to be able to have a rule e.g. "first video StreamOrder
< first audio StreamOrder
", right?
Not yet implemented but something we could add.
Yes, the idea is a multi stream comparison where "first video StreamOrder < first audio StreamOrder".
@joe-sciame-wm you may test this snapshot (for CLI) or this snapshot (JS). GUI is not yet ready, you have to write the policy by hand but the way to write it is not difficult.
With e.g.
p2a.xml (the policy corresponding to your example):
<policy type="and" name="Video before audio">
<description>Check if video is before audio</description>
<rule name="StreamOrder" value="StreamOrder" tracktype="Video" occurrence="1" operator="<">
<source value="StreamOrder" tracktype="Audio" occurrence="1"/>
</rule>
</policy>
p2b.xml (the opposite)
<policy type="and" name="Video before audio">
<description>Check if video is before audio</description>
<rule name="StreamOrder" value="StreamOrder" tracktype="Video" occurrence="1" operator=">">
<source value="StreamOrder" tracktype="Audio" occurrence="1"/>
</rule>
</policy>
Result is:
> mediaconch example.mkv -p p2a.xml
pass! .\example.mkv
> mediaconch example.mkv -p p2b.xml
fail! .\example.mkv
-- [fail:Video before audio]
-- [fail:StreamOrder]
@joe-sciame-wm @plondino you may test this GUI snapshot for creating such policy directly from the GUI instead of having to create it manually.
Hi Jerome, An interesting use came up this week that we didn't have a good way to solve in media conch. The issue was out of order tracks. In some cases, tracks can get out of order and we wanted to add a check that the audio was after video in the ordering. Because we aren't able to compare different tracks' values, we ended up making sure that the video was the first stream, but we are worried this may be too restrictive across all the formats.
Thoughts on a capability to be able to compare two values across tracks?