PyAV Version: 16.1.0
Driver Version: 595.58.03
CUDA Version: 13.2
NVIDIA GeForce RTX 3090
import av
import av.codec
import av.logging
av.logging.restore_default_callback()
import av.datasets
from av.codec.hwaccel import HWAccel, hwdevices_available
hwaccel = HWAccel(device_type="cuda", allow_software_fallback=False)
container = av.open(
av.datasets.curated(
"pexels/time-lapse-video-of-night-sky-857195.mp4"
),
hwaccel=hwaccel,
)
for packet in container.demux(video=0):
packet.decode()
print(container.streams[0].codec)
av.codec.codec.dump_hwconfigs()
Output
<av.Codec h264 mode='r'>
Hardware configs:
...
h264
<av.HWConfig device_type=cuda format=cuda is_supported=True at 0xe3feb60>
h264_amf
<av.HWConfig device_type=amf format=amf is_supported=True at 0xe0d8520>
h264_cuvid
<av.HWConfig device_type=cuda format=cuda is_supported=True at 0xe0fd720>
...