无法正确构建OpenCV + GStreamer(MinGW,Windows)

时间:2019-07-10 22:42:55

标签: opencv mingw gstreamer gstreamer-1.0

我正在尝试运行测试管道:

 cv::VideoCapture cap = cv::VideoCapture(" autovideosrc ! videoconvert ! appsink0 ", cv::CAP_GSTREAMER);

但是它不会启动并返回下一个调试信息(请参见下文)。我使用mingw32 7.3.0编译了opencv。 Gstreamer的版本也是32位。有什么事吗 win7,mingw 7.3.0,opencv 4.1.0,gstreamer 1.16.0

    0:00:00.040498363  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstdecklink.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.412: Failed to load plugin 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstdecklink.dll': 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstdecklink.dll': 
The specified procedure was not found.
        0:00:00.061620856  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstopenh264.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.432: Failed to load plugin 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstopenh264.dll': 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstopenh264.dll': 
The specified procedure was not found.
        0:00:00.072668621  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstsoundtouch.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.442: Failed to load plugin 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstsoundtouch.dll': 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstsoundtouch.dll': 
The specified procedure was not found.
        0:00:00.088487674  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstsrt.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.465: Failed to load plugin 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstsrt.dll': 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstsrt.dll': 
The specified procedure was not found.
        0:00:00.089972159  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgsttaglib.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.465: Failed to load plugin 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgsttaglib.dll': 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgsttaglib.dll': 
The specified procedure was not found.
        0:00:00.097988553  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstwebrtcdsp.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.475: Failed to load plugin 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstwebrtcdsp.dll': 'E:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstwebrtcdsp.dll': 
The specified procedure was not found.
        0:00:00.107822720  6904   1F44A7C0 WARN                 filesrc gstfilesrc.c:533:gst_file_src_start:<source> error: No such file "C:\Users\Shmeisser\Documents\build-untitled2-Desktop_Qt_5_9_4_MinGW_32bit-Debug\ autovideosrc ! videoconvert ! appsink0"
        0:00:00.107911655  6904   1F44A7C0 WARN                 basesrc gstbasesrc.c:3469:gst_base_src_start:<source> error: Failed to start
        0:00:00.108341459  6904   1F44A7C0 WARN                 filesrc gstfilesrc.c:533:gst_file_src_start:<source> error: No such file "C:\Users\Shmeisser\Documents\build-untitled2-Desktop_Qt_5_9_4_MinGW_32bit-Debug\ autovideosrc ! videoconvert ! appsink0"
        0:00:00.108391029  6904   1F44A7C0 WARN                 basesrc gstbasesrc.c:3469:gst_base_src_start:<source> error: Failed to start
        0:00:00.108489004  6904   1F44A7C0 WARN                 filesrc gstfilesrc.c:533:gst_file_src_start:<source> error: No such file "C:\Users\Shmeisser\Documents\build-untitled2-Desktop_Qt_5_9_4_MinGW_32bit-Debug\ autovideosrc ! videoconvert ! appsink0"
        0:00:00.108535367  6904   1F44A7C0 WARN                 basesrc gstbasesrc.c:3469:gst_base_src_start:<source> error: Failed to start
        0:00:00.108575898  6904   1F44A7C0 WARN                 basesrc gstbasesrc.c:3824:gst_base_src_activate_push:<source> Failed to start in push mode
        0:00:00.108603015  6904   1F44A7C0 WARN                GST_PADS gstpad.c:1142:gst_pad_set_active:<source:src> Failed to activate pad

1 个答案:

答案 0 :(得分:0)

这很容易,但是有很多出错的地方。 Gstreamer管道工程。扩展说明可在此处Tutorial中找到。

Gstreamer result

我用过3) -OpenCV源代码opencv-4.2.0 -OpenCV源代码opencv_contrib-4.2.0 -Cmake 3.17发布候选3,这很重要。 我将开发和运行时安装程序用于MSVC GStreamer Gstreamer 1.16.2运行时安装程序 Gstreamer 1.16.2开发安装程序 what to download 从源代码和OpenCV安装生成OpenCV时,通常遵循以下步骤。此外,在cmake配置期间需要添加这些资源。
Gstreamer Cmake opencv config

现在在Visual Studio 2019中构建由CMAKE生成的OpenCV项目。最后一个重要的事情是设置环境变量以查找GStreamer运行时。进入系统变量路径:添加

  • xxx \ 1.0 \ x86_64 \ bin
  • xxx \ 1.0 \ x86_64 \ lib
  • xxx \ 1.0 \ x86_64 \ lib \ gstreamer-1.0 Environmental variables