Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to select encoder when saving AVIF #3582

Closed
saschanaz opened this issue Mar 5, 2023 · 1 comment
Closed

Way to select encoder when saving AVIF #3582

saschanaz opened this issue Mar 5, 2023 · 1 comment
Labels

Comments

@saschanaz
Copy link

Feature request

What are you trying to achieve?

Wanted to try rav1e as the default AVIF encoder was too slow, but it seems there's no way for that.

When you searched for similar feature requests, what did you find that might be related?

Couldn't find one when querying with "select encoder". The caller isn't setting encoder, so I guess it's an issue anyway.

sharp/src/pipeline.cc

Lines 915 to 923 in 844deaf

VipsArea *area = reinterpret_cast<VipsArea*>(image.heifsave_buffer(VImage::option()
->set("strip", !baton->withMetadata)
->set("Q", baton->heifQuality)
->set("compression", baton->heifCompression)
->set("effort", baton->heifEffort)
->set("bitdepth", 8)
->set("subsample_mode", baton->heifChromaSubsampling == "4:4:4"
? VIPS_FOREIGN_SUBSAMPLE_OFF : VIPS_FOREIGN_SUBSAMPLE_ON)
->set("lossless", baton->heifLossless)));

What would you expect the API to look like?

Perhaps .avif({ encoder: "rav1e" })?

What alternatives have you considered?

Wanted to try wasm-vips instead but it seemingly doesn't support heifsave at all. kleisauke/wasm-vips#44

Please provide sample image(s) that help explain this feature

(Not applicable)

@lovell
Copy link
Owner

lovell commented Mar 5, 2023

To use rav1e, you'll need to compile your own libvips, libheif and rav1e and install them globally before re-installing sharp.

There's an issue tracking the future possible use of rav1e in the prebuilt binaries at lovell/sharp-libvips#97 but there's a lack of recent evidence that it's still faster than aom, which is still under heavy development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants