The following settings are exactly the same, and it works when I build without gstreamer. But if I set gstreamer related, it doesn’t work.
I have tried many possibilities. I have been trying to install gstreamer, uninstall gstreamer, change gstreamer version, and build opencv these days. But there is no solution.
gstreamer installed in D:\gstreamer
added path D:\gstreamer\1.0\msvc_x86_64\bin
D:\gstreamer\1.0\msvc_x86_64\lib
D:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0
and cmake all ok without error.
Video I/O:
DC1394: NO
FFMPEG: YES (prebuilt binaries)
avcodec: YES (58.134.100)
avformat: YES (58.76.100)
avutil: YES (56.70.100)
swscale: YES (5.9.100)
avresample: YES (4.0.0)
GStreamer: YES (1.18.6)
DirectShow: YES
Media Foundation: YES
DXVA: YES
vs2022 built without error too.
y final in python when i import cv2.
it show
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\code\python\yolov5cvhwpy311\!testcvHW2.py", line 1, in <module>
import cv2
File "D:\python\Python311\Lib\site-packages\cv2\__init__.py", line 181, in <module>
bootstrap()
File "D:\python\Python311\Lib\site-packages\cv2\__init__.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\python\Python311\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing cv2: 找不到指定的模块。
Process finished with exit code 1