日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

Ubuntu 14.04编译opencv_videoio.dir/src/cap_gstreamer.cpp报错

發布時間:2023/12/15 Ubuntu 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Ubuntu 14.04编译opencv_videoio.dir/src/cap_gstreamer.cpp报错 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

今天在研究AR_ToolKit,它需要搭建OpenCV的環境。于是下載了OpenCV的源碼進行編譯(下載方法就是直接git克隆git clone https://github.com/opencv/opencv)。

編譯opencv的過程中,一開始都一帆風順,不過后來遇到了以下問題:

[ 49%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_gstreamer.cpp.o In file included from /usr/include/gstreamer-0.10/gst/pbutils/encoding-profile.h:29:0,from /home/leon/open_source/opencv/modules/videoio/src/cap_gstreamer.cpp:69: /usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:35:9: error: ‘GstMiniObjectClass’ does not name a typetypedef GstMiniObjectClass GstDiscovererStreamInfoClass;^ /usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:83:9: error: ‘GstMiniObjectClass’ does not name a typetypedef GstMiniObjectClass GstDiscovererContainerInfoClass;^ /usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:104:9: error: ‘GstMiniObjectClass’ does not name a typetypedef GstMiniObjectClass GstDiscovererAudioInfoClass;^ /usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:129:9: error: ‘GstMiniObjectClass’ does not name a typetypedef GstMiniObjectClass GstDiscovererVideoInfoClass;^ /usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:159:9: error: ‘GstMiniObjectClass’ does not name a typetypedef GstMiniObjectClass GstDiscovererSubtitleInfoClass;^ /usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:202:9: error: ‘GstMiniObjectClass’ does not name a typetypedef GstMiniObjectClass GstDiscovererInfoClass;^ In file included from /home/leon/open_source/opencv/modules/videoio/src/cap_gstreamer.cpp:69:0: /usr/include/gstreamer-0.10/gst/pbutils/encoding-profile.h:47:9: error: ‘GstMiniObjectClass’ does not name a typetypedef GstMiniObjectClass GstEncodingProfileClass;^ /usr/include/gstreamer-0.10/gst/pbutils/encoding-profile.h:66:9: error: ‘GstEncodingProfileClass’ does not name a typetypedef GstEncodingProfileClass GstEncodingContainerProfileClass;^ /usr/include/gstreamer-0.10/gst/pbutils/encoding-profile.h:85:9: error: ‘GstEncodingProfileClass’ does not name a typetypedef GstEncodingProfileClass GstEncodingVideoProfileClass;^ /usr/include/gstreamer-0.10/gst/pbutils/encoding-profile.h:104:9: error: ‘GstEncodingProfileClass’ does not name a typetypedef GstEncodingProfileClass GstEncodingAudioProfileClass;^ /home/leon/open_source/opencv/modules/videoio/src/cap_gstreamer.cpp: In member function ‘virtual bool GStreamerCapture::grabFrame()’: /home/leon/open_source/opencv/modules/videoio/src/cap_gstreamer.cpp:268:57: error: ‘gst_app_sink_pull_sample’ was not declared in this scopesample = gst_app_sink_pull_sample(GST_APP_SINK(sink));^ /home/leon/open_source/opencv/modules/videoio/src/cap_gstreamer.cpp: In member function ‘virtual bool CvVideoWriter_GStreamer::open(const char*, int, double, CvSize, bool)’: /home/leon/open_source/opencv/modules/videoio/src/cap_gstreamer.cpp:1515:25: error: ‘GST_VIDEO_FORMAT_ENCODED’ was not declared in this scopeinput_pix_fmt = GST_VIDEO_FORMAT_ENCODED;^ /home/leon/open_source/opencv/modules/videoio/src/cap_gstreamer.cpp: In member function ‘virtual bool CvVideoWriter_GStreamer::writeFrame(const IplImage*)’: /home/leon/open_source/opencv/modules/videoio/src/cap_gstreamer.cpp:1686:26: error: ‘GST_VIDEO_FORMAT_ENCODED’ was not declared in this scopeif (input_pix_fmt == GST_VIDEO_FORMAT_ENCODED) {^ make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_gstreamer.cpp.o] 錯誤 1 make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] 錯誤 2 make: *** [all] 錯誤 2

提取其中一句來看看:

/usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:202:9: error: ‘GstMiniObjectClass’ does not name a typetypedef GstMiniObjectClass GstDiscovererInfoClass;

很明顯,與gstreamer-0.10有關。再去分析下CMakeList文件,以gstreamer為關鍵詞查找,發現有如下命令:

OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT ANDROID) ) OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF ) OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )

可以看出,這就明確表示了cmakelist必須依賴于gstreamer-0.10。這里順便介紹一下gstreamer-0.10,根據百度百科,GStreamer是用來構建流媒體應用的開源多媒體框架(framework),其目標是要簡化音/視頻應用程序的開發,目前已經能夠被用來處理像 MP3、Ogg、MPEG1、MPEG2、AVI、Quicktime 等多種格式的多媒體數據。在linux中,進行視頻處理的時候,有時候我們需要讀入各種各樣格式的視頻。在沒有相應的解碼器的時候,我們是無法正確讀入數據的,所以要正確安裝gstreamer才能實現各種格式視頻的正確讀取。

于是,乖乖的安裝吧:

sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

裝完,再編譯,一切OK啦!

總結

以上是生活随笔為你收集整理的Ubuntu 14.04编译opencv_videoio.dir/src/cap_gstreamer.cpp报错的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。