OpenCV 3.3 - CMake cannot find ffmpeg libraries

asked 2017-08-29 03:58:04 -0600

simozz gravatar image

I am trying to cross compile opencv libraries with FFMPEG support but OpenCV build process is unable to find the cross compiled (from scratch) FFMPEG and its libraries, which are successfully installed in the cross-toolchain installation directory.

The folders and libs installed paths are (I think I didn't miss someone):

/path/to/cross/toolchain/sysroot/usr/include/usr/bin/ffmpeg
/path/to/cross/toolchain/sysroot/usr/include/usr/share/doc/ffmpeg
/path/to/cross/toolchain/sysroot/usr/include/usr/share/ffmpeg
/path/to/cross/toolchain/sysroot/usr/include/libavcodec
/path/to/cross/toolchain/sysroot/usr/include/libavdevice
/path/to/cross/toolchain/sysroot/usr/include/libavfilter
/path/to/cross/toolchain/sysroot/usr/include/libavformat
/path/to/cross/toolchain/sysroot/usr/include/libavutil
/path/to/cross/toolchain/sysroot/usr/lib/libavcodec.a
/path/to/cross/toolchain/sysroot/usr/lib/libavdevice.a
/path/to/cross/toolchain/sysroot/usr/lib/libavfilter.a
/path/to/cross/toolchain/sysroot/usr/lib/libavformat.a
/path/to/cross/toolchain/sysroot/usr/lib/libavutil.a
/path/to/cross/toolchain/sysroot/usr/lib/pkgconfig/libavcodec.pc
/path/to/cross/toolchain/sysroot/usr/lib/pkgconfig/libavdevice.pc
/path/to/cross/toolchain/sysroot/usr/lib/pkgconfig/libavfilter.pc
/path/to/cross/toolchain/sysroot/usr/lib/pkgconfig/libavformat.pc
/path/to/cross/toolchain/sysroot/usr/lib/pkgconfig/libavutil.pc
/path/to/cross/toolchain/sysroot/usr/lib/pkgconfig/libswresample.pc
/path/to/cross/toolchain/sysroot/usr/lib/pkgconfig/libavutil.pc
/path/to/cross/toolchain/sysroot/usr/lib/pkgconfig/libswscale.pc

PKG_CONFIG_PATH is set to /path/to/cross/toolchain/sysroot/usr/lib/pkgconfig/, however, OpenCV still cannot find FFMPEG libraries:

--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      NO
--       avcodec:                   NO
--       avformat:                  NO
--       avutil:                    NO
--       swscale:                   NO
--       avresample:                NO

What's wrong with FFMPEG path recognition ? What is the correct way to make it find FFMPEG ?

edit retag flag offensive close merge delete