mozilla / mp4parse-rust

Parser for ISO Base Media Format aka video/mp4 written in Rust.
Mozilla Public License 2.0
406 stars 62 forks source link

`mif1` compatible_brands interoperability problem #236

Closed kornelski closed 3 years ago

kornelski commented 4 years ago

This parser, and therefore Firefox requires ftyp's compatbile_brands to contain mif1. Chrome and libavif don't require this.

AFAIK it's a recommendation in the HEIF spec, but it's not required: https://aomediacodec.github.io/av1-avif/#image-and-image-collection-brand

AVIF images with empty or different compatible_brands work in Chrome, but not in Firefox.

I suggest just dropping the check of compatbile_brands.

cconcolato commented 4 years ago

In the general ISOBMFF/HEIF philosophy, brands are not mandatory. They describe what you are expected to find in the file. So it is possible that a file without the mif1 could be processed by a MIAF reader if it validates all the MIAF requirements (e.g. presence of a meta box, with a handler of type pict, ...).

That said, MIAF is about increasing interoperability by putting more constraints on the files. MIAF indicates in section 7.2.1.2:

The FileTypeBox shall contain, in the compatible_brands list [...] mif1

So strictly speaking a file that does not contain the mif1 brand is invalid. Of course, players are free to do whatever they want with invalid files that happen to just miss the mif1 brand.