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


 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

九世坛主

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值