Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 711022

Summary: media-libs/libavif library for AV1 Image File Format (AVIF)
Product: Gentoo Linux Reporter: Daniel Novomeský <dnovomesky>
Component: New packagesAssignee: Default Assignee for New Packages <maintainer-wanted>
Status: RESOLVED FIXED    
Severity: enhancement CC: herrtimson, johnnybit, jstein, sam
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/17293
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 715658    
Bug Blocks:    
Attachments: Initial version of ebuild
improved ebuild
This ebuild should work for future releases too
This ebuild should work for future releases too
Version bump
Ebuild using rav1e's C API

Description Daniel Novomeský 2020-02-28 10:20:37 UTC
I would like that gentoo has support for AV1 Image File Format (AVIF). It is a new image format which I use already because it is much better than traditional JPG. Netflix wrote about this format too: https://netflixtechblog.com/avif-for-next-generation-image-coding-b1d75675fe4

There is a libavif available to handle AVIF format: https://github.com/AOMediaCodec/libavif
I use libavif in my open-source programs (like https://www.reddit.com/r/AV1/comments/f9wuw5/avif_support_for_qt_based_applications/ ) and I also use gentoo (since 2005).

The git master of media-gfx/darktable already uses libavif, so adding package like media-libs/libavif will be needed sooner or later.

Would it be acceptable to add libavif to gentoo?

libavif itself is a portable C code but it has optional dependencies. It is necessary to choose at least one of them during build time. libavif can optionally use:
media-libs/libaom (but it has to be enough fresh snapshot from git at least v1.0.0-errata1-avif)
media-libs/dav1d
media-video/rav1e
or libgav1 (not in portage yet, https://chromium.googlesource.com/codecs/libgav1/ )

On my computer I typically configure libavif to use media-libs/libaom-9999 only (as libaom has both AV1 decoder and encoder, dav1d&libgav1 are only decoders, rav1e is only encoder). Other developers prefer to use combination of dav1d & rav1e.

I observed that after upgrading media-libs/libaom-9999 I have to rebuild libavif so my programs continue to work correctly.

I did not create any .ebuild yet
Comment 1 Daniel Novomeský 2020-03-30 16:05:21 UTC
Created attachment 627480 [details]
Initial version of ebuild

I started to learn how to make ebuilds, attaching first version.
Comment 2 Daniel Novomeský 2020-03-31 17:00:51 UTC
Created attachment 628038 [details]
improved ebuild

The new version of the ebuild provides following tools too:
avifdec
avifenc

dav1d, libaom
are optional use flags. At least one of them must be selected.

libaom-1.0.0 is not good for AVIF. It should be one of the newer snapshots, at least 1.0.0-errata1-avif
Comment 3 Aaron W. Swenson gentoo-dev 2020-03-31 19:47:00 UTC
Good start!

CMAKE_ECLASS=cmake doesn't have an impact on anything. Remove it.

src_install doesn't deviate from the default. So, you can exclude the function altogether.

I'd move the libaom warning to either pkg_postinst() if it's a short emerge or pkg_pretend() if it's a long emerge.

SRC_URI should make use of ${PV}. This will make it easy to version bump later.
Comment 4 Daniel Novomeský 2020-04-01 20:31:09 UTC
Created attachment 628612 [details]
This ebuild should work for future releases too

Thank you for the feedback.
I made few edits.
Comment 5 Daniel Novomeský 2020-04-01 21:15:51 UTC
Created attachment 628614 [details]
This ebuild should work for future releases too
Comment 6 Daniel Novomeský 2020-04-02 14:31:03 UTC
Created attachment 629022 [details]
Version bump
Comment 7 Daniel Novomeský 2020-04-08 19:28:16 UTC
libavif can optionally use rav1e too (instead of libaom), but we need media-video/rav1e to install C API library first. See https://bugs.gentoo.org/701384
Comment 8 Daniel Novomeský 2020-04-13 16:47:38 UTC
Created attachment 632704 [details]
Ebuild using rav1e's C API

media-video/rav1e now produce C API used by libavif, so this is new ebuild which is capable to optionally use the API.
Comment 9 Daniel Novomeský 2020-09-27 20:36:11 UTC
Package was added to ::gentoo