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

How to improve performance of AVIF encode times (single frame at a time) #6

Open
kevinmershon opened this issue Feb 6, 2025 · 0 comments

Comments

@kevinmershon
Copy link

I've created an issue along this topic at strukturag/libheif#1458 but wanted to specifically reference the encode example here as I am unsure if I'm doing things correctly.

I have a persistent flow of screenshots from a screen capture process and want to take screenshots and encode them to AVIF single frames as quickly as possible. Right now working with libheif and libheif-sharp with the AOM encoder the fastest I can get it to encode (based on the encoder sample in this repo) is about 3.5-10 seconds per frame. This is awfully slow.

By comparison, in C# with a regular CanvasRenderTarget I can encode a full desktop screenshot in 15-25ms. On MacOS I can encode jpegs around 7ms and AVIF around 25ms. I feel like I have to be missing something with the way I'm setting things up.

Notably, it is specifically the call to context.EncodeImage that takes so long, if that is at all helpful.

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

No branches or pull requests

1 participant