cross compile 交叉编译 ffmpeg

   ffmpeg 支持各种压缩格式的视频解码库,经常出现在各种播放器中,交叉编译也是一项麻烦的事情。

1. 下载ffmpeg 源码包   http://ffmpeg.org/releases/ffmpeg-3.4.tar.bz2

 

2.  进入源码目录 ,配置configure 文件  

 

  ./configure --sysroot=/opt/poky/2.0.1/sysroots/aarch64-poky-linux --cc=aarch64-poky-linux-gcc --ar=aarch64-poky-linux-ar --enable-cross-compile --target-os=linux --arch=aarch64  --prefix=/exports/rfs/usr  --enable-shared

 

  配置过程比较关键  ,由于没有加  --ar = 。。。 会导致 Error: no such instruction: `rev16 %r。。。。 表示无法调用汇编代码

3. make make过程中会出现 

  strip: Unable to recognise the format of the input file问题 

  原因是 交叉工具编译环境和本地环境 中的 strip 程序冲突   可以 用  type  strip 看看

  解决办法是     cp /opt/poky/2.0.1/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/5.1.1/strip /opt/poky/2.0.1/sysroots/x86_64-pokysdk-linux/usr/bin/ .... (只添加strip 一个程序就够了,不然会出错)

4. make install 

  完成交叉编译。

posted @ 2017-11-07 13:36  hutian  阅读(4391)  评论(0编辑  收藏  举报