Skip to content

Comments

Fix VideoCapture not able to read AV1 encoded files on Linux#1209

Open
ladaapp wants to merge 3 commits intoopencv:4.xfrom
ladaapp:add_linux_av1_decoding
Open

Fix VideoCapture not able to read AV1 encoded files on Linux#1209
ladaapp wants to merge 3 commits intoopencv:4.xfrom
ladaapp:add_linux_av1_decoding

Conversation

@ladaapp
Copy link

@ladaapp ladaapp commented Feb 17, 2026

Hi, this is an attempt to fix #908 as AV1 encoded files are pretty common nowadays. My assumption is that there is no av1 decoder available in the official wheel as the same works just fine using opencv-python from ArchLinux build against their ffmpeg build.

On Windows av1 decoding works but not on Linux using the official wheels. I am not sure but I assume there is some kind of fallback mechanism which then uses Windows-native frameworks for decoding which is not available on Linux hence it fails on Linux using ffmpeg backend.

Didn't adjust the arm images yet, wanted to get some feedback first if I'm going in the right direction here. Waiting for the CI to run through to create a wheel I can test if this actually fixes the issue 🤞
edit: looks like CI doesn't run without approval by maintainers, so changed to ready-for-review

fixes: #1205
fixes: #908

@ladaapp ladaapp marked this pull request as draft February 17, 2026 17:47
@ladaapp ladaapp marked this pull request as ready for review February 17, 2026 17:52
@asmorkalov asmorkalov self-requested a review February 18, 2026 14:28
@asmorkalov asmorkalov self-assigned this Feb 18, 2026
@ladaapp
Copy link
Author

ladaapp commented Feb 19, 2026

I also added the fix for #1205

When building the wheel locally I can see the fonts being picked up and being added to the wheel so this should fix it:

  adding 'cv2/qt/fonts/DejaVuSans-Bold.ttf'
  adding 'cv2/qt/fonts/DejaVuSans-BoldOblique.ttf'
  adding 'cv2/qt/fonts/DejaVuSans-ExtraLight.ttf'
  adding 'cv2/qt/fonts/DejaVuSans-Oblique.ttf'
  adding 'cv2/qt/fonts/DejaVuSans.ttf'
  adding 'cv2/qt/fonts/DejaVuSansCondensed-Bold.ttf'
  adding 'cv2/qt/fonts/DejaVuSansCondensed-BoldOblique.ttf'
  adding 'cv2/qt/fonts/DejaVuSansCondensed-Oblique.ttf'
  adding 'cv2/qt/fonts/DejaVuSansCondensed.ttf'
  adding 'cv2/qt/plugins/platforms/libqxcb.so'
[ci@85baca4688fe work]$ python3.13 -m pip install --user ./opencv_python-4.13.0.92-cp313-cp313-linux_x86_64.whl
Processing ./opencv_python-4.13.0.92-cp313-cp313-linux_x86_64.whl
Requirement already satisfied: numpy>=2 in /home/ci/.local/lib/python3.13/site-packages (from opencv-python==4.13.0.92) (2.4.2)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.13.0.92
[ci@85baca4688fe work]$ ls /home/ci/.local/lib/python3.13/site-packages/cv2/qt/fonts
DejaVuSans-BoldOblique.ttf  DejaVuSansCondensed-BoldOblique.ttf  DejaVuSansCondensed-Oblique.ttf  DejaVuSans-ExtraLight.ttf  DejaVuSans.ttf
DejaVuSans-Bold.ttf         DejaVuSansCondensed-Bold.ttf         DejaVuSansCondensed.ttf          DejaVuSans-Oblique.ttf

(only needed for the manylinux 2_28 image, manylinux2014 does not not remove dejavu-sans when uninstalling libpng (and doesn't have a yum mark or autoremove option)

@asmorkalov
The CI currently fails as the image is not available on that image repository. Not sure I can fix that chicken/egg problem. Not sure, but I think you have to continue here and build and push these image to the quay.io/opencv-ci repository as I wouldn't have permissions to do that. Not sure how these docker images are updated, doesn't seem to be automated within this repository here. So your assistance would be appreciated.

@ladaapp ladaapp force-pushed the add_linux_av1_decoding branch from e82e57c to 6ce8d0d Compare February 19, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants