Issue 1:
System Information

OpenCV python version: 4.7.0

Operating System / Platform: Ubuntu 22.04

OpenVINO version: 2022.2.0 (need to use this specific version)

Python version: 3.9.16 (need to use this, it is the highest supported by OpenVINO 2022.2.0)

Detailed description

I am working in a virtual environment py3.9_openvino_env.

Following these instructions with flags

-D BUILD_INFO_SKIP_EXTRA_MODULES=ON \
-D BUILD_EXAMPLES=OFF \
-D BUILD_JASPER=OFF \
-D BUILD_JAVA=OFF \
-D BUILD_JPEG=ON \
-D BUILD_APPS_LIST=version \
-D BUILD_opencv_apps=ON \
-D BUILD_opencv_java=OFF \
-D BUILD_OPENEXR=OFF \
-D BUILD_PNG=ON \
-D BUILD_TBB=OFF \
-D BUILD_WEBP=OFF \
-D BUILD_ZLIB=ON \
-D WITH_1394=OFF \
-D WITH_CUDA=OFF \
-D WITH_EIGEN=OFF \
-D WITH_GPHOTO2=OFF \
-D WITH_GSTREAMER=ON \
-D OPENCV_GAPI_GSTREAMER=OFF \
-D WITH_GTK_2_X=OFF \
-D WITH_IPP=OFF \
-D WITH_JASPER=OFF \
-D WITH_LAPACK=OFF \
-D WITH_MATLAB=OFF \
-D WITH_MFX=ON \
-D WITH_OPENCLAMDBLAS=OFF \
-D WITH_OPENCLAMDFFT=OFF \
-D WITH_OPENEXR=OFF \
-D WITH_OPENJPEG=OFF \
-D WITH_QUIRC=OFF \
-D WITH_TBB=OFF \
-D WITH_TIFF=OFF \
-D WITH_VTK=OFF \
-D WITH_WEBP=OFF \
-D CMAKE_USE_RELATIVE_PATHS=ON \
-D CMAKE_SKIP_INSTALL_RPATH=ON \
-D ENABLE_BUILD_HARDENING=ON \
-D ENABLE_CONFIG_VERIFICATION=ON \
-D ENABLE_PRECOMPILED_HEADERS=OFF \
-D ENABLE_CXX11=ON \
-D INSTALL_PDB=ON \
-D INSTALL_TESTS=ON \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D CMAKE_INSTALL_PREFIX=install \
-D OPENCV_SKIP_PKGCONFIG_GENERATION=ON \
-D OPENCV_SKIP_PYTHON_LOADER=OFF \
-D OPENCV_SKIP_CMAKE_ROOT_CONFIG=ON \
-D OPENCV_GENERATE_SETUPVARS=OFF \
-D OPENCV_BIN_INSTALL_PATH=bin \
-D OPENCV_INCLUDE_INSTALL_PATH=include \
-D OPENCV_LIB_INSTALL_PATH=lib \
-D OPENCV_CONFIG_INSTALL_PATH=cmake \
-D OPENCV_3P_LIB_INSTALL_PATH=3rdparty \
-D OPENCV_SAMPLES_SRC_INSTALL_PATH=samples \
-D OPENCV_DOC_INSTALL_PATH=doc \
-D OPENCV_OTHER_INSTALL_PATH=etc \
-D OPENCV_LICENSES_INSTALL_PATH=etc/licenses \
-D OPENCV_INSTALL_FFMPEG_DOWNLOAD_SCRIPT=ON \
-D BUILD_opencv_world=OFF \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=ON \
-D PYTHON3_PACKAGES_PATH=install/python/python3 \
-D PYTHON3_LIMITED_API=ON \
-D HIGHGUI_PLUGIN_LIST=all \
-D OPENCV_PYTHON_INSTALL_PATH=python \
-D CPU_BASELINE=SSE4_2 \
-D OPENCV_IPP_GAUSSIAN_BLUR=ON \
-D WITH_OPENVINO=ON \
-D VIDEOIO_PLUGIN_LIST=gstreamer,mfx \
-D CMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \
-D CMAKE_BUILD_TYPE=Release ~/opencv

After the installation I do not see the "Intel Inference Engine" under "Other third-party libraries":

$ python -c "import cv2; print(cv2.__file__)"
/home/user0/py3.9_openvino_env/lib/python3.9/site-packages/cv2/__init__.py
$ python -c "import cv2; print(cv2.getBuildInformation())"

General configuration for OpenCV 4.7.0 =====================================
Version control: 4.7.0-dirty

Extra modules:
Location (extra): /io/opencv_contrib/modules
Version control (extra): 4.7.0
...
Other third-party libraries:
Intel IPP: 2020.0.0 Gold [2020.0.0]
at: /io/_skbuild/linux-x86_64-3.7/cmake-build/3rdparty/ippicv/ippicv_lnx/icv
Intel IPP IW: sources (2020.0.0)
at: /io/_skbuild/linux-x86_64-3.7/cmake-build/3rdparty/ippicv/ippicv_lnx/iw
VA: NO
Lapack: YES (/lib64/libopenblas.so)
Eigen: NO
Custom HAL: NO
Protobuf: build (3.19.1)

OpenCL: YES (no extra features)
Include path: /io/opencv/3rdparty/include/opencl/1.2
Link libraries: Dynamic load
...

And when running a test code (provided below, simple test just to see if model is read correctly) I get an error:

$ python opencv_app.py
Traceback (most recent call last):
File "/home/user0/Downloads/model_files/opencv_app.py", line 19, in <module>
net = cv2.dnn.readNetFromModelOptimizer(bin = model_bin, xml = config_xml)
cv2.error: OpenCV(4.7.0) /io/opencv/modules/dnn/src/plugin_wrapper.impl.hpp:313: error: (-213:The function/feature is not implemented) Backend (plugin) is not available: 'openvino' in function 'createPluginDNNNetworkBackend'

Reviewing change log, I see OpenCV 4.6.0 has initial support of OpenVINO 2022.1, which is one version older than I am using. Can the behavior I am experiencing be caused by the fact that OpenVINO 2022.2 is not explicitly supported by OpenCV yet?

P.S. Another short set of instructions I tried following from here with

$ echo $ngraph_DIR
/home/user0/intel/openvino_2022.2.0/runtime/cmake

(OpenVINO changed the folder structure not long ago so "deployment_tools" folder does not exist anymore) but Intel Inference Engine still not appearing in cv2.getBuildInformation()

Steps to reproduce

opencv_app.py:

import cv2

model_bin = '/home/user0/Downloads/model/FP16/ssd_mobilenet_v1_coco.bin'
config_xml = '/home/user0/Downloads/model/FP16/ssd_mobilenet_v1_coco.xml'

net = cv2.dnn.readNetFromModelOptimizer(bin = model_bin, xml = config_xml)

net.setPreferableBackend(cv2.dnn.DNN_BACKEND_INFERENCE_ENGINE)
net.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD)

The .bin and .xml files are here: ssd_mobilenet_v1_coco.zip. This model is distributed by OpenVINO. I used the OpenVINO tool omz_downloader to download original TensorFlow model files and omz_converter to convert it to the IR format (.bin & .xml).

Error:

$ python opencv_app.py
Traceback (most recent call last):
File "/home/user0/Downloads/model/opencv_app.py", line 19, in <module>
net = cv2.dnn.readNetFromModelOptimizer(bin = model_bin, xml = config_xml)
cv2.error: OpenCV(4.7.0) /io/opencv/modules/dnn/src/plugin_wrapper.impl.hpp:313: error: (-213:The function/feature is not implemented) Backend (plugin) is not available: 'openvino' in function 'createPluginDNNNetworkBackend'

Issue submission checklist

I report the issue, it's not a question

I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution

I updated to the latest OpenCV version and the issue is still there

There is reproducer code and related data files (videos, images, onnx, etc)

Issue 2:
System information (version)

OpenCV => 3.4.3-openvino

Operating System / Platform => Linux Ubuntu 16.04

Detailed description

Hello, I'm using Intel Up-Board Squared to develop a programm which needs to compress video by using INTEL_MFX apiPreference to speed up the process.

I've compiled OpenCV with Intel Media SDK backend, and the compiler didn't give any errors to my code.

int fourcc = cv::VideoWriter::fourcc('H','2','6','4');

cv::VideoWriter writer("filename.mp4", cv::INTEL_MFX, fourcc, 30, cv::Size(1280,720), true);

What interesting is, when I run the code, it will show a line with MFX: unsupported extension: /dev/video0, but the video could be written in a new file.

The video file which was written is very large. A video about 30 seconds can be 70 MB large. I think that the video has been written without compressing with H264.

I also installed Intel Quick Sync Video for ffmpeg.

up-board@upboard-UP-APL01:~$ ffmpeg -codecs | grep 'qsv'ffmpeg version n3.4-dev-2711-g587fada Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
configuration: --enable-libmfx
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_qsv h264_vdpau h264_cuvid ) (encoders: h264_nvenc h264_qsv h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )
DEV.L. hevc H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_qsv hevc_cuvid ) (encoders: nvenc_hevc hevc_nvenc hevc_qsv hevc_vaapi )
DEV.L. mpeg2video MPEG-2 video (decoders: mpeg2video mpegvideo mpegvideo_vdpau mpeg2_v4l2m2m mpeg2_qsv mpeg2_cuvid ) (encoders: mpeg2video mpeg2_qsv mpeg2_vaapi )
D.V.L. vc1 SMPTE VC-1 (decoders: vc1 vc1_vdpau vc1_qsv vc1_v4l2m2m vc1_cuvid )
DEV.L. vp8 On2 VP8 (decoders: vp8 vp8_v4l2m2m vp8_cuvid vp8_qsv ) (encoders: vp8_v4l2m2m vp8_vaapi )

I think that it's correctly installed.

Is there anyone who has experience with Media SDK backend for OpenCV? Hope someone can help me.

Greetings,

Yiyun

Xref: Intel-Media-SDK/MediaSDK#944