shimat / opencvsharp

OpenCV wrapper for .NET
Apache License 2.0
5.22k stars 1.13k forks source link

Avif encoder not available #1671

Open robert-mihalache opened 1 month ago

robert-mihalache commented 1 month ago

Summary of your issue

When calling EmEncode with .avif extension an exception is being generated, informing the encoder is not available. OpenCV 4.9 documentation mentions support for this format.

Environment

Write your environment.

OpenCV4Sharp 4.9 Windows 11 x64 Visual Studio 2022 17.9.7

Write here

Example code:

private readonly int[] _parametersAvif = [512, 60];
Cv2.ImEncode(".avif", _image, out byte[] buffer, _parametersAvif);

Output:

OpenCvSharp.OpenCVException: 'could not find encoder for the specified extension'

What did you intend to be?

Return the buffer containing the encoded image