亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

OpenCV2.4.9版本編譯

發布時間:2020-03-04 22:50:42 來源:網絡 閱讀:748 作者:fengyuzaitu 欄目:軟件技術

1)linux查看opencv安裝路徑及版本號
查看linux下的opencv安裝庫:
pkg-config opencv --libs
查看linux下的opencv安裝版本:
pkg-config opencv --modversion
查看linux下的opencv安裝路徑:
find / -iname "*opencv*"



2)編譯指令

創建庫目錄: ?? mkdir install

創建生成目錄 : ? mkdir build

進入目錄: cd build

執行生成Makefile:


cmake -D WITH_CUDA=OFF \
??????????? -D CMAKE_BUILD_TYPE=Release \
??????????? -D CMAKE_INSTALL_PREFIX=cmake -D WITH_CUDA=OFF \
??????????? -D CMAKE_BUILD_TYPE=Release \
??????????? -D CMAKE_INSTALL_PREFIX=/home/packages/opencv/install \
??????????? -D WITH_IPP=OFF \
??????????? -D WITH_FFMPEG=ON? \
??????????? -D BUILD_TESTS=OFF \
??????????? -D BUILD_PERF_TESTS=OFF \
??????????? -D INSTALL_PYTHON_EXAMPLES=OFF \
??????????? -D INSTALL_C_EXAMPLES=OFF \
??????????? -D PYTHON_EXECUTABLE=$(which python) \
??????????? -D BUILD_EXAMPLES=OFF .. \
??????????? -D WITH_IPP=OFF \
??????????? -D WITH_FFMPEG=ON? \
??????????? -D BUILD_TESTS=OFF \
??????????? -D BUILD_PERF_TESTS=OFF \
??????????? -D INSTALL_PYTHON_EXAMPLES=OFF \
??????????? -D INSTALL_C_EXAMPLES=OFF \
??????????? -D PYTHON_EXECUTABLE=$(which python) \
??????????? -D BUILD_EXAMPLES=OFF ..


生成安裝:make && make install


編譯異常

1)[ 98%] Linking CXX executable ../../bin/opencv_performance
../../lib/libopencv_highgui.so.2.4.9: undefined reference to `avcodec_alloc_frame'
../../lib/libopencv_highgui.so.2.4.9: undefined reference to `avcodec_encode_video'
collect2: error: ld returned 1 exit status
apps/haartraining/CMakeFiles/opencv_performance.dir/build.make:105: recipe for target 'bin/opencv_performance' failed
make[2]: *** [bin/opencv_performance] Error 1
CMakeFiles/Makefile2:3388: recipe for target 'apps/haartraining/CMakeFiles/opencv_performance.dir/all' failed
make[1]: *** [apps/haartraining/CMakeFiles/opencv_performance.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

問題:undefined reference to `avcodec_alloc_frame'

通過grep -r?"avcodec_alloc_frame"? / 查詢全局文本返回空

最新版本的FFmpeg該函數的實現名稱已經改變,下載ffmpeg-2.3.tar.bz2源碼編譯

2)已經編譯ffmpeg-2.3.tar.bz2,生成libswresample.so.0無法找到,將libswresample.so.0拷貝到/lib64目錄下

/usr/bin/ld: warning: libswresample.so.0, needed by //home/dong/ffmpeg/ffmpeg-2.3/build/lib/libavcodec.so.55, not found (try using -rpath or -rpath-link)
//home/dong/ffmpeg/ffmpeg-2.3/build/lib/libavcodec.so.55: undefined reference to `swr_init@LIBSWRESAMPLE_0'
//home/dong/ffmpeg/ffmpeg-2.3/build/lib/libavcodec.so.55: undefined reference to `swr_close@LIBSWRESAMPLE_0'
//home/dong/ffmpeg/ffmpeg-2.3/build/lib/libavcodec.so.55: undefined reference to `swr_is_initialized@LIBSWRESAMPLE_0'
//home/dong/ffmpeg/ffmpeg-2.3/build/lib/libavcodec.so.55: undefined reference to `swr_free@LIBSWRESAMPLE_0'
//home/dong/ffmpeg/ffmpeg-2.3/build/lib/libavcodec.so.55: undefined reference to `swr_alloc@LIBSWRESAMPLE_0'
//home/dong/ffmpeg/ffmpeg-2.3/build/lib/libavcodec.so.55: undefined reference to `swr_convert@LIBSWRESAMPLE_0'
collect2: error: ld returned 1 exit status
apps/haartraining/CMakeFiles/opencv_performance.dir/build.make:105: recipe for target 'bin/opencv_performance' failed
make[2]: *** [bin/opencv_performance] Error 1
CMakeFiles/Makefile2:3388: recipe for target 'apps/haartraining/CMakeFiles/opencv_performance.dir/all' failed
make[1]: *** [apps/haartraining/CMakeFiles/opencv_performance.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error

3)export PKG_CONFIG_PATH=/home/dong/opencv-2.4.9/install/lib/pkgconfig/;$PKG_CONFIG_PATH

指定OpenCV優先查找編譯好的FFmpeg,而不是系統的FFmpeg庫

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

阿坝县| 新竹市| 根河市| 舟曲县| 玉龙| 永兴县| 鸡东县| 望谟县| 杨浦区| 茌平县| 东乡| 石家庄市| 都江堰市| 盖州市| 隆回县| 绵阳市| 疏勒县| 遂昌县| 苍南县| 新蔡县| 洛阳市| 临沭县| 内黄县| 海安县| 肃宁县| 荃湾区| 乐昌市| 徐闻县| 河津市| 易门县| 永丰县| 太仆寺旗| 屯门区| 于都县| 观塘区| 砀山县| 巴青县| 平谷区| 河南省| 开江县| 治多县|