Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
160 Views

OpenCV with VAAPI video capture support .

Wondering how to enable VAAPI (e.g. iHD driver)  in OpenCV to do video capture (e.g. cv::VideoCapture  ) ?  Any pointers will be appreciated. 

0 Kudos
4 Replies
Highlighted
Employee
160 Views

Currently the only way is to use GStreamer backend (change avidemux element according to your container):

VideoCapture cap(
    "filesrc location=<filename> ! avidemux ! vaapidecodebin ! appsink",
    CAP_GSTREAMER);

You can read more here: https://github.com/opencv/opencv/wiki/Video-capture-and-write-benchmark

0 Kudos
Highlighted
Beginner
160 Views

Thanks Maksim,  wondering if  the same  video decoding acceleration in OpenCV can also be achieved through the Intel MediaSDK ?  The following option is there OpenCV. 

 

CAP_INTEL_MFX 

Python: cv.CAP_INTEL_MFX

Intel MediaSDK.

 

0 Kudos
Highlighted
Employee
160 Views

Yes, it is possible: https://github.com/opencv/opencv/wiki/MediaSDK-encode-decode-backend

But this backend supports only raw video stream files and have limited number of parameters.

0 Kudos
Highlighted
Beginner
160 Views

Thanks,   lack of container support makes it much less useful for now.   That is a dead end for  what I am trying to do.  Is it possible to build an entire GEN9 (GPU) accelerated pipeline to  process  h.264 video in mpeg4 container   along the following line (with or without OpenCV , OpenCL is ok) ? 

[RTSP, h.264/mpeg4] -> [decode] -> [ resize/transform] ->[low level computer vision, e.g. VME]->[CPU for high level computer vision]

If possible, would be great to have an idea of how to make that work . 

 

0 Kudos