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
完成交叉編譯。
