Ask Your Question

haxan7's profile - activity

2020-03-10 20:41:36 -0600 received badge  Popular Question (source)
2016-08-05 08:21:34 -0600 received badge  Student (source)
2015-04-25 12:15:27 -0600 received badge  Critic (source)
2015-04-25 11:56:57 -0600 asked a question Error compiling opencv, undefined reference

I am compiling opencv with ffmpeg, I can't seem to fix the following error

/root/ARM_Install/include/../lib/libavformat.a(allformats.o): In function `av_register_all':
/root/SourceCode/FFmpeg/libavformat/allformats.c:59: undefined reference to `avcodec_register_all'
/root/ARM_Install/include/../lib/libavformat.a(avidec.o): In function `avi_extract_stream_metadata':
/root/SourceCode/FFmpeg/libavformat/avidec.c:411: undefined reference to `avpriv_exif_decode_ifd'
/root/ARM_Install/include/../lib/libavformat.a(avienc.o): In function `avi_write_header':
/root/SourceCode/FFmpeg/libavformat/avienc.c:201: undefined reference to `avpriv_pix_fmt_bps_avi'
/root/ARM_Install/include/../lib/libavformat.a(concatdec.o): In function `detect_stream_specific':
/root/SourceCode/FFmpeg/libavformat/concatdec.c:189: undefined reference to `av_bitstream_filter_init'
/root/ARM_Install/include/../lib/libavformat.a(concatdec.o): In function `filter_packet':
/root/SourceCode/FFmpeg/libavformat/concatdec.c:447: undefined reference to `av_bitstream_filter_filter'
/root/ARM_Install/include/../lib/libavformat.a(dtsdec.o): In function `dts_probe':
/root/SourceCode/FFmpeg/libavformat/dtsdec.c:70: undefined reference to `avpriv_dca_convert_bitstream'
/root/SourceCode/FFmpeg/libavformat/dtsdec.c:111: undefined reference to `avpriv_dca_sample_rates'
/root/ARM_Install/include/../lib/libavformat.a(dv.o): In function `dv_frame_offset':
/root/SourceCode/FFmpeg/libavformat/dv.c:425: undefined reference to `av_dv_codec_profile2'
2015-04-23 03:49:02 -0600 answered a question Build OpenCV for Linux on ARM with FFmpeg

You need to export the path where you installed ffpmeg to PKG_CONFIG_PATH.

export PKG_CONFIG_PATH="ffpmegInstallPath/lib/pkgconfig":$PKG_CONFIG_PATH
2015-04-23 03:30:37 -0600 asked a question undefined reference to avcodec

Opencv fails to compile with ffmpeg.

Opencv version is 2.4.10 and ffmpeg is v2.

I have tried everything cant seem to fix this error.

Here is the output of cmake:

-- checking for module 'libavcodec'
--   found libavcodec, version 56.35.101
-- checking for module 'libavformat'
--   found libavformat, version 56.30.100
-- checking for module 'libavutil'
--   found libavutil, version 54.23.101
-- checking for module 'libswscale'
--   found libswscale, version 3.1.101
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      YES
--       codec:                     YES (ver 56.35.101)
--       format:                    YES (ver 56.30.100)
--       util:                      YES (ver 54.23.101)
--       swscale:                   YES (ver 3.1.101)
--       gentoo-style:              YES

Here is error:

Linking CXX executable ../../bin/opencv_test_core
/root/work/codesourcery/arm-2013.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libavcodec.so.56, needed by ../../lib/libopencv_highgui.so.2.4.10, not found (try using -rpath or -rpath-link)
/root/work/codesourcery/arm-2013.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libavformat.so.56, needed by ../../lib/libopencv_highgui.so.2.4.10, not found (try using -rpath or -rpath-link)
/root/work/codesourcery/arm-2013.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libavutil.so.54, needed by ../../lib/libopencv_highgui.so.2.4.10, not found (try using -rpath or -rpath-link)
/root/work/codesourcery/arm-2013.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libswscale.so.3, needed by ../../lib/libopencv_highgui.so.2.4.10, not found (try using -rpath or -rpath-link)

../../lib/libopencv_highgui.so.2.4.10: undefined reference to `avpicture_fill@LIBAVCODEC_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `avformat_find_stream_info@LIBAVFORMAT_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `av_free_packet@LIBAVCODEC_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `avformat_free_context@LIBAVFORMAT_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `av_register_all@LIBAVFORMAT_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `av_guess_codec@LIBAVFORMAT_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `avformat_new_stream@LIBAVFORMAT_56'
2015-04-21 06:47:38 -0600 received badge  Necromancer (source)
2015-04-21 06:00:42 -0600 answered a question Linking error: libzlib

I had the same problem.

Make sure that the following line in your arm-gnueabi.toolchain.cmake file is pointing to the correct address

set(ARM_LINUX_SYSROOT /root/work/codesourcery/arm-2013.05 CACHE PATH "ARM cross compilation system root")

2015-04-21 05:50:21 -0600 answered a question Opencv static link error

I had the same problem.

Make sure that the following line in your arm-gnueabi.toolchain.cmake file is pointing to the correct address

set(ARM_LINUX_SYSROOT /root/work/codesourcery/arm-2013.05 CACHE PATH "ARM cross compilation system root")

2015-04-16 03:25:38 -0600 received badge  Enthusiast
2015-04-14 15:13:35 -0600 commented answer cross compile OpenCV with FFMPEG for ARM Linux

@Alexander I am using cross compile tool chain from Ubuntu repositories, I have merged ffmpeg install directories with usr/arm-linux-gnueabi but still can't find ffmpeg. Help?

2015-04-14 01:42:13 -0600 asked a question How to cross compile OpenCV with ffmpeg

I am trying to cross compile Opencv with ffmpeg with platforms/linux/arm-gnueabi.toolchain.cmake toolchain file.

I have successfully compiled opencv with this toolchain file. But no matter what I do i can't get it find cross-compiled ffmpeg libraries.

There are numerous questions regarding this posted everywhere on the web but there is no concrete answer.

The problem that I am facing is very similar to http://answers.opencv.org/question/45...

2015-04-13 13:56:28 -0600 received badge  Supporter (source)
2015-04-13 06:53:44 -0600 asked a question Opencv VideoCapture tcp stream

I am a opencv noob.

I want to run an opencv project on arm processor. My current cross compilation of opencv is as follows

 DC1394 1.x:                  NO

 DC1394 2.x:                  NO

 FFMPEG:                      NO

   codec:                     NO

   format:                    NO

   util:                      NO

   swscale:                   NO

   gentoo-style:              YES

 GStreamer:                   NO

 OpenNI:                      NO

 OpenNI PrimeSensor Modules:  NO

 PvAPI:                       NO

 GigEVisionSDK:               NO

 UniCap:                      NO

 UniCap ucil:                 NO

 V4L/V4L2:                    YES/YES

 XIMEA:                       NO

 Xine:                        NO

Currently the projects runs without errors but is unable to capture videos.

What is the bare minimum I need to cross-compile opencv with to be able to capture tcp stream.

2015-04-12 23:38:07 -0600 asked a question Opencv with ffmpeg

What do I get if I compile opencv with ffmpeg?

2015-02-14 14:05:46 -0600 asked a question Redefinition of ‘class cv::SIFT’

I have compiled and install opencv 2.3.1 from source. And installed libopencv-nonfree-dev from ppa:xqms/opencv-nonfree.

When I try to compile code that is supposed to run with opencv 2.3.1 I get the following error.

......
/usr/include/opencv2/nonfree/features2d.hpp:58:20: error: redefinition of ‘class cv::SIFT’
 class CV_EXPORTS_W SIFT : public Feature2D
......
/usr/local/include/opencv2/features2d/features2d.hpp:304:18: error: previous definition of ‘class cv::SIFT’
 class CV_EXPORTS SIFT

How do I resolve this?

Edit: I have compiled a slightly tweaked version of opencv. Using newer versions of opencv is not a choice.