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

PyAV Hardware Acceleration Module Not Found #2

Closed
latishab opened this issue Dec 31, 2024 · 2 comments
Closed

PyAV Hardware Acceleration Module Not Found #2

latishab opened this issue Dec 31, 2024 · 2 comments

Comments

@latishab
Copy link

Description

When trying to use hardware acceleration with VideoReader, this error occurs:

Traceback (most recent call last):
  File ".../examples/process_dive_video.py", line 38, in <module>
    from JaxVidFlow.video_reader import VideoReader
  File ".../src/JaxVidFlow/video_reader.py", line 72, in <module>
    class VideoReader:
  File ".../src/JaxVidFlow/video_reader.py", line 74, in VideoReader
    hwaccel: av.codec.hwaccel.HWAccel | str | None = None, jax_device: Any = None, max_workers: int | None = None):
             ^^^^^^^^^^^^^^^^
AttributeError: module 'av.codec' has no attribute 'hwaccel'

Environment

  • PyAV version: 14.0.1
  • Python version: 3.11.0
  • OS: macOS 15.1.1

Expected Behavior

Hardware acceleration should be available through av.codec.hwaccel.HWAccel as documented in PyAV's type hints.

Notes

The hwaccel module appears to be missing from av.codec, despite being present in PyAV's type definitions.

After reinstalling the av, it seems like the latest version is 14.0.1, but what you put in requirements.txt is >=14.1.0. After checking the PyAV repo, you also have made changes two weeks ago. Let me know what should be done.

@matthewlai
Copy link
Owner

Hi Latitia,

Sorry about that. I've only just implemented hardware acceleration in PyAV 2 weeks ago in PyAV-Org/PyAV#1685

It is planned to be part of the 14.1.0 release but that hasn't been released yet.

In the mean time you can install PyAV from Github instead, with FFmpeg from Homebrew.

Something like (sorry untested - I did this a long time ago) -

brew install ffmpeg
git clone https://github.com/PyAV-Org/PyAV.git
cd PyAV
make  # possibly some missing libraries here that you'll have to install through Homebrew
pip uninstall av
pip install .

@latishab
Copy link
Author

Great, thanks for the info!

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

2 participants