Input video capture ffmpeg flags (OpenCV-Python)

asked 2020-03-23 20:35:27 -0500

Hello, I'm trying to figure out how to pass FFMPEG flags to the VideoCapture function. From what I can see, there are no hooks for this in the python library.

I'm trying to pass a h264 stream to OpenCV's DNN module in Linux. My issue is the H264 streams will only be decoded via software, instead of using my nvidia card's nvdec/ncuvid. My CPU is a 3770k, CPU usage is quite high decoding a large h264 stream, and then resizing it for dnn.

edit retag flag offensive close merge delete


hi, I have a problem with grabbing UDP raw streams. I think it is relevant with this issue, I need to pass FFMPEG flags to VÄ°, FLAGS) method but I'm not sure.

otoker gravatar imageotoker ( 2020-03-24 04:22:44 -0500 )edit

In the python implementation, you don't call the open function yourself. I think it's done inside the initialize func so i cannot seem to pass these flags.

jonathanlvaldez gravatar imagejonathanlvaldez ( 2020-03-25 03:20:50 -0500 )edit

hi jonathanlvaldez, I use java OpenCV so I wonder about flags to display rawvideo format.

otoker gravatar imageotoker ( 2020-03-28 05:53:11 -0500 )edit