LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-16-2012, 09:06 AM   #1
lijing8898
LQ Newbie
 
Registered: Jun 2012
Posts: 1

Rep: Reputation: Disabled
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


*****************************
 
Old 06-18-2012, 04:10 AM   #2
barunparichha
Member
 
Registered: Jun 2006
Location: Bangalore,india
Distribution: Linux(Redhat,fedora,suse,ubantu), Solaris (s8/s9/s10/nevada/open-solaris)
Posts: 303

Rep: Reputation: 32
ffmpeg/avformat.h
check if you really have this file, if yes put this into your PATH variable.
 
Old 06-18-2012, 04:45 AM   #3
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Rep: Reputation: 189Reputation: 189
@lijing8898: please post commands output inside code tags, otherwise your post will be mostly unreadable and uselessly long.
Your issue, however, is that you're using a too recent ffmpeg version (0.11.1) which the OpenCV version you're using doesn't support. You should downgrade ffmpeg and retry or try compiling an OpenCV snapshot from svn against your current ffmpeg version.
@barunparichha: putting a header file inside the PATH variable is nonsense. PATH should contain only directories inside of which executables are to be found. It has nothing to do with headers and libraries.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenCV - Pixel format of incoming image is unsupported by OpenCV golmschenk Programming 1 04-01-2011 12:32 PM
Install FFMPEG and FFMPEG-PHP on fedora10 & 12 cks Linux - Server 2 09-17-2010 01:55 PM
unable to use configure opencv with ffmpeg srinivasmiriyalu Linux - Newbie 2 10-02-2009 10:29 AM
installing ffmpeg for opencv josemalo Linux - Software 1 02-27-2006 10:34 PM
[Questions] AVCodec/AVFormat - FFMPEG - Linux vs. Windows 7.e.Q Linux - Software 0 02-09-2006 12:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration