Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 711022 - media-libs/libavif library for AV1 Image File Format (AVIF)
Summary: media-libs/libavif library for AV1 Image File Format (AVIF)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement with 2 votes (vote)
Assignee: Default Assignee for New Packages
URL:
Whiteboard:
Keywords: PullRequest
Depends on: 715658
Blocks:
  Show dependency tree
 
Reported: 2020-02-28 10:20 UTC by Daniel Novomeský
Modified: 2020-09-27 20:36 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Initial version of ebuild (libavif-0.6.2.ebuild,598 bytes, text/plain)
2020-03-30 16:05 UTC, Daniel Novomeský
Details
improved ebuild (libavif-0.6.2.ebuild,963 bytes, text/plain)
2020-03-31 17:00 UTC, Daniel Novomeský
Details
This ebuild should work for future releases too (libavif-0.6.2.ebuild,1.28 KB, text/plain)
2020-04-01 20:31 UTC, Daniel Novomeský
Details
This ebuild should work for future releases too (libavif-0.6.2.ebuild,1.11 KB, text/plain)
2020-04-01 21:15 UTC, Daniel Novomeský
Details
Version bump (libavif-0.6.3.ebuild,1.10 KB, text/plain)
2020-04-02 14:31 UTC, Daniel Novomeský
Details
Ebuild using rav1e's C API (libavif-0.6.3-r1.ebuild,1.38 KB, text/plain)
2020-04-13 16:47 UTC, Daniel Novomeský
Details

Note You need to log in before you can comment on or make changes to this bug.
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