Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

OpenCV with VAAPI video capture support .

sg
Beginner
1,616 Views

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
Maksim_S_Intel
Employee
1,616 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
sg
Beginner
1,616 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
Maksim_S_Intel
Employee
1,616 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
sg
Beginner
1,616 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
Reply