Calling VideoFrame.to_ndarray(format="rgb24") on frames decoded by h264_cuvid/hevc_cuvid (NVDEC) raises [Errno 95] Operation not supported in 17.0.0.
This worked correctly in 16.1.0.
Error
[swscaler] Unsupported input (Operation not supported): fmt:nv12 csp:gbr prim:reserved trc:reserved -> fmt:rgb24 csp:gbr prim:reserved trc:reserved OSError: [Errno 95] Operation not supported
Reproducing
import av
codec = av.Codec("hevc_cuvid", "r")
ctx = av.CodecContext.create(codec)
ctx.options = {"surfaces": "8"}
with open("sample.h265", "rb") as f:
raw = f.read()
packet = av.Packet(raw)
frames = ctx.decode(packet)
for frame in frames:
img = frame.to_ndarray(format="rgb24") # raises in 17.0.0, works in 16.1.0
- PyAV 16.1.0: works
- PyAV 17.0.0: fails
- Decoder: hevc_cuvid (NVDEC)
- Source streams: H.265