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


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章