Ask Your Question
2

Build OpenCV for Linux on ARM with FFmpeg

asked 2014-03-28 10:58:10 -0600

guraaf gravatar image

updated 2014-03-28 11:14:33 -0600

Hi all, I saw very helpful instructions at: http://docs.opencv.org/2.4/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html

However, it doesn't talk about how to enable FFmpeg and saying that it is optional. I am trying to build OpenCV 2.4.8 for Linux running on ARM Cortex-A9. This is what I did:

cd opencv-2.4.8/platforms/linux/
mkdir build-soft
cd build-soft
cmake -DSOFTFP=ON -DENABLE_NEON=ON -DCMAKE_TOOLCHAIN_FILE=../arm-gnueabi.toolchain.cmake ../../..

This went through. Now when I inspect the configuration produced I see that I didn't get FFmpeg support:

-   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      NO
--       codec:                     NO
--       format:                    NO
--       util:                      NO
--       swscale:                   NO
--       gentoo-style:              YES

Any suggestions to build FFmpeg for 32-bit ARM would help. I am cross-compiling on 64-bit Ubuntu 12.04. Also, I went ahead and tried to build but failed with a problem due to Python. I think I don't have the correct Python cross-compiled for 32-bit ARM. How can I do so? The error was:

[100%] Building CXX object modules/python/CMakeFiles/opencv_python.dir/src2/cv2.cpp.o
In file included from /usr/include/python2.7/Python.h:58:0,
                 from /home/tmp/opencv-2.4.8/modules/python/src2/cv2.cpp:6:
/usr/include/python2.7/pyport.h:849:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
[100%] Built target opencv_perf_stitching
Linking CXX executable ../../bin/opencv_test_contrib

Thanks in advance!

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2014-04-07 07:35:12 -0600

Hi,

i have the same problem. Also cross compiling in Ubuntu for ARM Controller.

But i tried to configure with the cmake gui. I added the Variable FFMPEG_LIB_DIR an sactivated WITH_FFMPEG, but pressing the configure button i get,

checking for module 'libavcodec' package 'libavcodec' not found checking for module 'libavformat' package 'libavformat' not found checking for module 'libavutil' package 'libavutil' not found checking for module 'libswscale' package 'libswscale' not found Looking for libavformat/avformat.h Looking for libavformat/avformat.h - not 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: NO codec: NO format: NO util: NO swscale: NO gentoo-style: NO GStreamer: NO OpenNI: NO OpenNI PrimeSensor Modules: NO PvAPI: NO GigEVisionSDK: NO UniCap: NO UniCap ucil: NO V4L/V4L2: NO/YES XIMEA: NO Xine: NO

Have you solved your problem?

Regards,

Alexander

edit flag offensive delete link more

Comments

Hi were you able to resolve your issue? I am stuck at the same place?

newuser gravatar imagenewuser ( 2014-10-29 22:26:08 -0600 )edit
0

answered 2015-04-23 03:49:02 -0600

haxan7 gravatar image

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

export PKG_CONFIG_PATH="ffpmegInstallPath/lib/pkgconfig":$PKG_CONFIG_PATH
edit flag offensive delete link more
-1

answered 2014-05-20 10:51:45 -0600

Hi! Just an Idea... Have you tried using cmake-gui instead?. You can add the toolchain file "arm-gnueabi.toolchain.cmake" and by using cmake-gui add or remove options, maybe the ones related to FFMPEG

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-03-28 10:58:10 -0600

Seen: 4,249 times

Last updated: Apr 23 '15