IMX8 ffmpeg和opencv组件编译

IMX8MINI
linux

编译组件 FFMPEG:
root@imx8mmevk:/bin# ffmpeg --version
ffmpeg version N-97346-g07ecc46 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7.3.1 (Linaro GCC 7.3-2018.05) 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]
  configuration: --prefix=/opt/ffmpeg --arch=arm64 --target-os=linux --enable-shared --cross-prefix=aarch64-linux-gnu-
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 78.102 / 58. 78.102
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
Unrecognized option '-version'.
Error splitting the argument list: Option not found

由于使用aarch64-linux-gnu-gcc工具,编译总是报:
aarch64-poky-linux-gcc is unable to create an executable file.

更换了工具gcc就编译通过
root@sunday:~/ffmpeg/imx_ffmpeg# make install

编译opencv:
说明原系统里已有了,是4.0的版本,只是没有注意到,又重新编译了
中间遇到问题:
[ 45%] Linking CXX executable ../../bin/opencv_test_core
../../lib/libopencv_imgcodecs.so.4.3.0: undefined reference to `png_do_expand_palette_rgb8_neon'
../../lib/libopencv_imgcodecs.so.4.3.0: undefined reference to `png_init_filter_functions_neon'
../../lib/libopencv_imgcodecs.so.4.3.0: undefined reference to `png_do_expand_palette_rgba8_neon'
../../lib/libopencv_imgcodecs.so.4.3.0: undefined reference to `png_riffle_palette_neon'
collect2: error: ld returned 1 exit status
modules/core/CMakeFiles/opencv_test_core.dir/build.make:958: recipe for target 'bin/opencv_test_core' failed
make[2]: *** [bin/opencv_test_core] Error 1
CMakeFiles/Makefile2:1309: recipe for target 'modules/core/CMakeFiles/opencv_test_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_test_core.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

解决方式:
${HOME}/opencv-3.3.1/3rdparty/libpng/pngpriv.h

/*#  if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \ */
#   if defined(PNG_ARM_NEON) && (defined(ARM_NEON) || defined(__ARM_NEON)) && \
   defined(PNG_ALIGNED_MEMORY_SUPPORTED)
#     define PNG_ARM_NEON_OPT 2
#  else
#     define PNG_ARM_NEON_OPT 0
#  endif
#endif


 

你可能感兴趣的:(imx8m,驱动开发,软件移植,linux驱动开发)