Git Product home page Git Product logo

avif-serialize's Introduction

AVIF image serializer (muxer)

Minimal writer for AVIF header structure. This is lean, safe-Rust alternative to libavif. It creates the jungle of MPEG/HEIF/MIAF/ISO-BMFF "boxes" as appropriate for AVIF files. Supports alpha channel embedding.

Compatible with decoders in Chrome 85+, libavif v0.8.1, and Firefox 92.

Together with rav1e it allows pure-Rust AVIF image encoding.

Requirements

Usage

  1. Compress pixels using an AV1 encoder, such as rav1e. libaom works too.

  2. Call avif_serialize::serialize_to_vec(av1_data, None, width, height, 8)

See cavif for example usage.

avif-serialize's People

Contributors

kornelski avatar wantehchang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

avif-serialize's Issues

The alpha image item should also have a mandatory ispe property

This issue was first reported in Chromium issue 1246678.

If an AVIF image encoded by cavif has an alpha plane, the alpha image item in the AVIF image does not have an ispe property. This is not standards-compliant.

HEIF (ISO/IEC 23008-12:2017) Section 6.5.3.1 says the ispe property is mandatory (per item). See page 11.

MIAF (ISO/IEC 23000-22) Section 7.3.6.3 (Image spatial extents) reiterates that:

ISO/IEC 23008-12 requires that every image item be associated with a property of this type.

See page 15.

Standards Compatibility

First of all, thank you for all of your amazing image work!

It looks like Chrome 91 (current beta) is requiring extra format compatibility for AVIF files. Images generated by cavif that work fine in the current Chrome stable will stop working down the road.

See e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=1198455&q=avif&can=2

Running an example cavif-generated image through the AOM AVIF Validator turns up the following issues:

  • [miaf][Rule #1] Error: The HandlerBox shall be the first contained box within the MetaBox
  • [miaf][Rule #2] Error: compatible_brands list shall contain 'miaf' (not found) and 'mif1' (found)
  • [miaf][Rule #4] Error: 'hdlr' not found in MetaBox
  • [miaf][Rule #24] Error: Found no 'pixi' associated for 1 displayable (not hidden) images (ItemIds={1})

(I believe it is primarily the lack of "pixies" Chrome is upset about. ๐Ÿ˜„)

I'm guessing this library (rather than ravif) is where fixes would be needed, but am unsure.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.