arm-linux-gcc ffmpeg x264 s3c2410

来源:互联网 发布:开源oa系统源码下载 编辑:程序博客网 时间:2024/06/06 04:21

由于我要用到在S3C2410开发板上用ffmpeg和x264进行解码,所以我移植了FFMPEG 和 X264

操作系统 ubuntu 8.0.4

交叉编译工具链 arm-linux-gcc 3.4.1

x264 和 ffmpeg 下载地址

http://bbs.chinavideo.org/viewthread.php?tid=1787&extra=page%3D1

 

 

由于之前的ffmpeg和x264都是在网上随便找的,所以有很多不兼容。包括在configure的时候和make的时候。

许多错误都是因为版本不相容造成的。例如x264版本低而ffmpeg版本高会造成解码函数的不相同,返回值和参数类型都不同。

下面我说说过程。

 

 

1:编译x264

./configure --enable-shared --prefix=/home/cm/x264/install --host=arm-linux

修改config.mak文件

ARCH=X86

改为

ARCH=ARM

 

CC=gcc

改为

CC=arm-linux-gcc

 

CFLAGS中 -DARCH_X86 删掉

 

make

 

make install

 

2:编译 ffmpeg

./configure --prefix=/home/cm/ffmpeg/install --disable-static --enable-shared --enable-gpl --enable-swscaler --enable-x264 --enable-xvid --disable-strip --arch=libavcodec/armv4l/ --disable-ffplay --disable-ffserver --disable-armv5te --disable-arm-v6 --disable-zlib --cress-compile --cross-prefix=/usr/local/arm/3.4.1/bin/arm-linux- --cc=gcc --enable-gpl --disable-opts --disable-network --extra-libs=/home/cm/x264/install/lib/libx264.so --extra-ldflags=/home/cm/x264/install/lib/libx264.a --disable-ipv6

 

make

make install