void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.59k stars 2.16k forks source link

libavif: defective packaging prevents avifenc from being useful #42272

Closed IcedQuinn closed 1 year ago

IcedQuinn commented 1 year ago

libavif is built in such a way that its companion program avifenc is included within system-wide PATH but is unable to encode. No encoders are bundled with it. It only includes a decoder (dav1d.)

You can verify the availability of encoders and decoders as in:

icedquinn@astaraline ~/Pictures> avifenc -h | grep Version
Version: 0.11.1 (dav1d [dec]:1.0.0)

avifenc is able to be built with other encoding libraries such as libaom (which is the absolute slowest but preserves the most image detail per byte.) A custom build depending on libaom shows a different result:

icedquinn@astaraline ~/Pictures> ~/code/external/libavif/build/avifenc -h | grep Version
Version: 0.11.1 (aom [enc/dec]:v3.5.0)

Now this part is tricky because the dependencies are build-time optional but not auto detected at run time. As I recall it supports SVT-AV1 (the fastest), rav1e, and libaom, with an additional subdependency that if libaom is built with JPEG-XL it will allow use of the butteraugli metric which further preserves image fidelity.

In ideal cases:

FFMPEG already depends on most/all of this so they will already be in the repository for that. This would likely just be some tweaks to build flags and dependencies. However those are foundational libraries so there is very likely to be a high amount of resistance to making these simple tweaks.

Currently you need to do a custom build of some of these libraries to actually encode AVIF. However, binaries are provided that are intended to do this but are misconfigured so as to be present but worthless.

oreo639 commented 1 year ago

Thanks, feel free to test https://github.com/void-linux/void-packages/pull/42438 Let me know if you run any issues.

github-actions[bot] commented 1 year ago

Issues become stale 90 days after last activity and are closed 14 days after that. If this issue is still relevant bump it or assign it.