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

Can't get AVIF encode to work #1038

Open
Zaczero opened this issue Oct 19, 2024 · 0 comments
Open

Can't get AVIF encode to work #1038

Zaczero opened this issue Oct 19, 2024 · 0 comments

Comments

@Zaczero
Copy link

Zaczero commented Oct 19, 2024

Expected behaviour

I expect the imencode AVIF to work properly, as it's supported by the upstream OpenCV.

Actual behaviour

cv2.imencode('.avif', img)
cv2.error: OpenCV(4.10.0) /io/opencv/modules/imgcodecs/src/loadsave.cpp:1141: error: (-2:Unspecified error) could not find encoder for the specified extension in function 'imencode'

I have tried installing libavif on my system but that did not resolve the issue. I believe this is a build-time issue.

Steps to reproduce

pip install opencv-python-headless
import cv2
import numpy as np

print(cv2.__version__)  # '4.10.0'

cv2.imwrite('test.avif', np.zeros((100, 100, 3), np.uint8))
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