I have been trying to find documentation for about an hour and gave up, deciding to recompile 4.5.1 to try to recover my setup…
The so called “improvement” of videoio was a cataclysmic change with poor documentation. ChangeLog · opencv/opencv Wiki · GitHub
I am running opencv and using the ffmpeg backend with cuda acceleration using the python API. I have compiled every version of opencv if contrib this far without any issues.
My question is this: What is the 4.5.2 new equivalent to setting up a video stream as I used to do with this:
os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"]="hwaccel;cuvid|video_codec;h264_cuvid|vsync;0" stream = cv2.VideoCapture(self.rtsp_server_uri, cv2.CAP_FFMPEG)
From all the documentation I found, it seems like I need to change to something like this:
os.environ[ "OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "hw_decoders_any;cuda|vsync;0" stream = cv2.VideoCapture(self.rtsp_server_uri, cv2.CAP_FFMPEG, (cv2.CAP_PROP_HW_ACCELERATION, cv2.VIDEO_ACCELERATION_ANY))
But nothing seems to work.
Edit: confirmed after re-compiling 4.5.1 release that it is back to working normally. This feature on 4.5.2 is breaking things and/or poorly documented.