交叉编译ffmpeg到beaglebone balck

工作需要在Beaglebone Black 上使用ffmpeg ,所以就是着使用Ubuntu 14.04交叉编译ffmpeg,且ffmpeg需要用到x264的解码功能,所以同时交叉编译libx264,在此记录以防以后工作需要。

首先在ubuntu中安装armhf的交叉编译工具

sudo apt-get install gcc-arm-linux-gnueabihf

然后下载libx264编译

wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar axvf last_x264.tar.bz2
cd x264-snapshot-20150814-2245
mkdir buildarm
cd buildarm
../configure --enable-pic --cross-prefix=arm-linux-gnueabihf- --host=arm-linux --prefix=/home/changer/Desktop/build/opt --extra-cflags=-march=armv7 -mtune=cortex-a8 --enable-shared --enable-strip
make -j4
make install

接下来就可以下载并且编译ffmpeg了

git clone git://source.ffmpeg.org/ffmpeg.git
#切换到当前程序所使用的版本
git reset --hard 750b10f
cd ffmpeg
mkdir buildarm
cd buildarm
../configure --extra-libs=-ldl --prefix=/home/changer/Desktop/build/opt --cross-prefix=arm-linux-gnueabihf- --arch=armv7-a --enable-neon --enable-armv6 --enable-cross-compile --target-os=linux --disable-libfreetype --enable-libx264 --enable-gpl --enable-nonfree --enable-version3 --disable-debug --enable-shared --enable-pic --extra-cflags='-I /home/changer/Desktop/build/opt/include  -mtune=cortex-a8' --extra-ldflags='-L /home/changer/Desktop/build/opt/lib'
make -j4
make install

将编译好的opt文件夹打包再更新到Beaglebone black上即可运行

tar acvf opt.tar.gz opt/
scp opt.tar.gz root@192.168.1.101:/opt

最终即可使用ffmpeg了
ffmpeg

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值