gpac / ComplianceWarden

A pluggable compliance checker (ISOBMFF, HEIF/MIAF/AVIF, AV1 HDR10+)
https://gpac.github.io/ComplianceWarden-wasm/
Other
16 stars 7 forks source link

Possible false positive error on meta arity #78

Closed bradh closed 4 months ago

bradh commented 4 months ago

Describe the issue

When running against a file I've cleaned up a bit (originally from a gopro camera), with the isobmff profile, I'm getting this:

+--------------------------------------+
|          isobmff validation          |
+--------------------------------------+

Specification description: ISO Base Media File Format
MPEG-4 part 12 - ISO/IEC 14496-12 - m17277 (6th+FDAM1+FDAM2+COR1-R4)

[isobmff][Rule #11] Error: Found 4 boxes { meta } but expected 0 with parents { moov }. Check your box structure.
[isobmff][Rule #11] Error: Wrong arity for boxes { vmhd smhd hmhd sthd nmhd } in parents { minf }: expected in range [1-1], found 0
[isobmff][Rule #11] Error: Wrong arity for boxes { vmhd smhd hmhd sthd nmhd } in parents { minf }: expected in range [1-1], found 0
[isobmff][Rule #11] Error: Found 5 boxes { meta } but expected 1 with parents { root }. Check your box structure.

========================================
[isobmff] 4 error(s), 0 warning(s).
========================================

===== Involved rules descriptions:

[isobmff][Rule #11] Table 1: box structure and arity
This is rather a safety check than a formal rule.

The second and third errors are probably valid - I need to remove some bogus headers and likely insert nmhd in place of the gopro (Quicktime) version of ISOBMFF.

I think the first and last errors are false positive, or perhaps a difference between 6th Ed and 7th Ed. I understand that it is finding meta boxes at places other than a single entity at the root level (in particular, in the moov). My file definitely does that - there are four trak in the moov, and each of them has meta. The root also has meta.

From ISO/IEC 14496-12:2022 Section 8.11.1.1 and Table 1, I think that is valid.

To Reproduce Steps to reproduce the behavior:

  1. Compliance Warden, version v34-master-rev11-gc7223fd
  2. Not able to provide - I'll have to sanitise if this is needed.
  3. ./bin/cw.exe --spec isobmff ~/eofff/goprotools/dump_gopro.mp4
  4. See above

Detailed analysis I think the arity needs to be refined.

Potential patch I may be able to address this given some direction.

rbouqueau commented 4 months ago

I have the DIS of the 8th Edition of ISOBMFF. It states in 8.11.1.1:

Box Type:   'meta'
Container:  File, Segment, MovieBox, TrackBox, MovieFragmentBox or TrackFragmentBox
Mandatory:  No
Quantity:   Zero or one (in File, MovieBox, and TrackBox),
            Zero or one (in Segment, MovieFragmentBox or TrackFragmentBox)

which is aligned the current code.

Can you send me your file separately for analysis?

bradh commented 4 months ago

I've tried guessing an email address (github user id + company domain), but it bounced. Can you ping me at bradh@frogmouth.net ?

rbouqueau commented 4 months ago

The test was too restrictive by making a cross-check in a box full hierarchy instead of the parent only. This is obliviously wrong in your use-case because the meta box can be located at several places in the same file.

I've pushed a fix. Let me know if it helps.

bradh commented 4 months ago

Works well for me. Happy for this to be closed.

bradh commented 4 months ago

@rbouqueau Thanks again.