2012-01-07 67 views
3

我正嘗試在Ubuntu 11.04上安裝Open-CV庫。使用ffmpeg安裝Open-CV時出錯

我遵循了InstallationGuide中的所有說明。

然而,隨着成功安裝後,我意識到,我沒有FFMPEG的支持,因爲在我的配置文件FFMPEG被禁用:

Video I/O: 
--  DC1394 1.x:     NO 
--  DC1394 2.x:     YES 
--  FFMPEG:      NO 
--  codec:     YES 
--  format:     YES 
--  util:      YES 
--  swscale:     NO 
--  gentoo-style:    YES 
--  GStreamer:     YES 
--  UniCap:      NO 
--  PvAPI:      NO 
--  V4L/V4L2:     Using libv4l 
--  Xine:      NO 

所以我嘗試安裝FFMEPG的描述下here後重建一切。

與指令

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ../OpenCV-2.3.1 

配置安裝後我跑make命令收到此錯誤:

make[2]: *** [bin/opencv_test_calib3d] Error 1 
make[1]: *** [modules/calib3d/CMakeFiles/opencv_test_calib3d.dir/all] Error 2 
make: *** [all] Error 2 

這是編譯的錯誤所在出來的一點:

Linking CXX executable ../../bin/opencv_test_calib3d 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_analysis_headerout' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_set_out_samplerate' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_set_disable_reservoir' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_encode_buffer' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vaUnmapBuffer' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vaDestroyBuffer' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `th_comment_clear' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_param_default' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_param_apply_profile' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_set_brate' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_encoder_headers' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `faacEncGetCurrentConfiguration' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_analysis_blockout' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_info_clear' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_analysis_buffer' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `th_comment_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vaCreateBuffer' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_set_bWriteVbrTag' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `faacEncSetConfiguration' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `th_encode_ctl' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `D_IF_decode' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `faacEncGetDecoderSpecificInfo' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_block_clear' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_close' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_encoder_encode' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_set_VBR' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `Encoder_Interface_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_analysis' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_get_framesize' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `faacEncOpen' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `th_encode_packetout' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_set_quality' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `Decoder_Interface_exit' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `th_encode_alloc' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_encode_setup_vbr' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `th_info_clear' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_set_in_samplerate' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_encoder_reconfig' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_param_apply_fastfirstpass' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_set_VBR_quality' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_set_mode' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `D_IF_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_set_num_channels' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `faacEncEncode' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_encode_setup_managed' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `Encoder_Interface_exit' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `Decoder_Interface_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vaRenderPicture' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_encode_ctl' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `th_info_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_analysis_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_encoder_delayed_frames' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_param_parse' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `th_encode_free' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `D_IF_exit' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_dsp_clear' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `Decoder_Interface_Decode' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vaMapBuffer' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_block_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_bit_depth' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_picture_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_encoder_close' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_encoder_open_120' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `faacEncClose' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vaEndPicture' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_encode_flush' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_encode_buffer_interleaved' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_comment_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_comment_clear' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_init_params' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `x264_param_default_preset' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_encode_setup_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_bitrate_addblock' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_comment_add_tag' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `th_encode_flushheader' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `lame_encode_buffer_int' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `th_encode_ycbcr_in' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_bitrate_flushpacket' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_analysis_wrote' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vorbis_info_init' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `Encoder_Interface_Encode' 
../../lib/libopencv_highgui.so.2.3.1: undefined reference to `vaBeginPicture' 
collect2: ld returned 1 exit status 

任何人都可以請告訴我安裝程序有什麼問題我在跟隨?

爲什麼存在此庫再分類錯誤?

回答

8

這些錯誤來自鏈接過程,它們通常意味着您缺少系統中的某些庫,或者它們位於不受構建過程搜索的位置。

我建議你Google這些符號知道你需要安裝哪些軟件包。

編輯:

總之,我們在私下有聊天,主要的問題是,X264是被靜態建。 建立庫--enable-shared的共享版本是必不可少的。 OP建議在所有配置選項中添加--prefix=/usr/local

+0

谷歌搜索沒有什麼幫助,我發現了另一個鏈接錯誤,但由於不同的問題(https://code.ros.org/trac/opencv/ticket/1077)。你能幫我理解爲什麼構建過程沒有找到它正在尋找的庫嗎?我應該更新一些環境變量嗎?任何其他想法?很多! – Matteo 2012-01-09 10:28:58

+0

也許我應該在'/etc/ld.so.conf.d'中添加一個文件來指定我安裝的x264和ffmpeg庫的路徑? – Matteo 2012-01-09 10:32:29

+0

在安裝ffmpeg後執行** cmake **時,您是否能夠在輸出文本中看到它實際上找到了ffmpeg?在Google上快速搜索也發現其中一些符號包含在軟件包** libmp3lame0 **中,您是否安裝了它? – karlphillip 2012-01-09 11:29:47