Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Build OpenCV for Linux on ARM with FFmpeg

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. Thanks in advance!

Build OpenCV for Linux on ARM with FFmpeg

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!