Community
cancel
Showing results for 
Search instead for 
Did you mean: 
sg
Beginner
613 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
Maksim_S_Intel
Employee
613 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

sg
Beginner
613 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.

 

Maksim_S_Intel
Employee
613 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.

sg
Beginner
613 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 . 

 

Reply