install OpenCV Looking for ffmpeg/avformat.h - not found
Hi,
I try to install OpenCV from ffmpeg. Some errors happen.
OS: Centos 6, 64bit
The ffmpeg has been already installed via following commands.
1)download ffmpeg-0.11.1.tar.gz
2)uncompress
3)su and cd .....
4)./configure --prefix=/usr --enable-shared --disable-yasm
5)make
6)make install
Then I install OpenCV as following commands.
1) download OpenCv-2.4.1.tar.bz2
2) uncompress
3) su and cd ...
4) modify CMakeLists.txt
a: commend on the sentence " set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )"
b: change "set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory") " to "set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Installation Directory") "
5) mkdir release
cd release
cmake ../
6) make
Here errors happen. It said that "../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avformat_find_stream_info' ...". And I noticed that "libavformat/avformat.h - found" appears after running "cmake ../". I am stumped. Would any one help me fix this problem? Thanks.
****************************
[root@localhost release]# ffmpeg -version
ffmpeg version 0.11.1
built on Jun 16 2012 18:45:01 with gcc 4.4.6 20110731 (Red Hat 4.4.6-3)
configuration: --prefix=/usr --enable-shared --disable-yasm
libavutil 51. 54.100 / 51. 54.100
libavcodec 54. 23.100 / 54. 23.100
libavformat 54. 6.100 / 54. 6.100
libavdevice 54. 0.100 / 54. 0.100
libavfilter 2. 77.100 / 2. 77.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
****************************
*****************************
[root@localhost release]# cmake ../
-- Detected version of GNU GCC: 44 (404)
-- Extracting svn version, please wait...
-- SVNVERSION: exported
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named numpy.distutils
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named sphinx
--
-- General configuration for OpenCV 2.4.1 =====================================
--
-- Platform:
-- Host: Linux 2.6.32-220.el6.x86_64 x86_64
-- CMake: 2.6.4
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/gmake
-- Configuration: RELEASE
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: /usr/bin/c++ (ver 4.4.6)
-- C++ flags (Release): -Wall -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -Wall -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3
-- C Compiler: /usr/bin/gcc
-- C flags (Release): -Wall -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -Wall -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3
-- Linker flags (Release):
-- Linker flags (Debug):
--
-- OpenCV modules:
-- To be built: calib3d contrib core features2d flann gpu highgui imgproc legacy ml nonfree objdetect photo stitching ts video videostab
-- Disabled: -
-- Disabled by dependency: -
-- Unavailable: androidcamera java python
--
-- GUI:
-- QT 4.x: NO
-- GTK+ 2.x: YES (ver 2.18.9)
-- GThread : YES (ver 2.22.5)
-- GtkGlExt: NO
-- OpenGL support: NO
--
-- Media I/O:
-- ZLib: /usr/lib64/libz.so (ver 1.2.3)
-- JPEG: /usr/lib64/libjpeg.so (ver 62)
-- PNG: /usr/lib64/libpng.so (ver 1.2.49)
-- TIFF: /usr/lib64/libtiff.so (ver 42)
-- JPEG 2000: /usr/lib64/libjasper.so (ver 1.900.1)
-- OpenEXR: NO
--
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: YES (ver 2.1.2)
-- FFMPEG: YES
-- codec: YES (ver 52.72.2)
-- format: YES (ver 52.64.2)
-- util: YES (ver 50.15.1)
-- swscale: YES (ver 0.11.0)
-- gentoo-style: YES
-- GStreamer:
-- base: YES (ver 0.10.29)
-- app: YES (ver 0.10.29)
-- video: YES (ver 0.10.29)
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- PvAPI: NO
-- UniCap: NO
-- UniCap ucil: NO
-- V4L/V4L2: Using libv4l (ver 0.6.3)
-- Xine: NO
--
-- Other third-party libraries:
-- Use IPP: NO
-- Use TBB: NO
-- Use Eigen: NO
--
-- Python:
-- Interpreter: /usr/bin/python2.6 (ver 2.6.6)
--
-- Documentation:
-- Build Documentation: NO
-- Sphinx: NO
-- PdfLaTeX compiler: NO
--
-- Tests and samples:
-- Tests: YES
-- Performance tests: YES
-- Examples: NO
--
-- Install path: /usr
--
-- cvconfig.h is in: /home/jing/Downloads/OpenCV-2.4.1/release
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jing/Downloads/OpenCV-2.4.1/release
[root@localhost release]# make
[ 0%] Built target opencv_core_pch_dephelp
[ 0%] Built target pch_Generate_opencv_core
[ 3%] Built target opencv_core
[ 3%] Built target opencv_ts_pch_dephelp
[ 3%] Built target pch_Generate_opencv_ts
[ 4%] Built target opencv_ts
[ 4%] Built target opencv_perf_core_pch_dephelp
[ 4%] Built target pch_Generate_opencv_perf_core
[ 4%] Built target opencv_highgui_pch_dephelp
[ 4%] Built target pch_Generate_opencv_highgui
[ 4%] Built target opencv_imgproc_pch_dephelp
[ 4%] Built target pch_Generate_opencv_imgproc
[ 9%] Built target opencv_imgproc
[ 12%] Built target opencv_highgui
Linking CXX executable ../../bin/opencv_perf_core
../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avformat_network_init'
../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avformat_find_stream_info'
../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avio_close'
/home/jing/scilab-5.3.3/lib/thirdparty/libxml2.so.2: undefined reference to `gzopen64'
../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avformat_new_stream'
../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avformat_close_input'
../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avformat_write_header'
../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avcodec_open2'
../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avio_open'
../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avformat_open_input'
../../lib/libopencv_highgui.so.2.4.1: undefined reference to `cvCreateCameraCapture_V4L(int)'
collect2: ld returned 1 exit status
make[2]: *** [bin/opencv_perf_core] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
make: *** [all] Error 2
*****************************
|