ffmpeg和ffplay交叉编译到arm开发板

交叉编译工具:arm-linux-gcc



一.先下载一下文件

1. yasm-1.2.0.tar.gz

2. x264-snapshot-20140424-2245.tar.bz2

3. xvidcore-1.1.3.tar.gz

4. SDL-1.2.15.tar.gz

5.  ffmpeg-1.2.2.tar.gz


链接如下

1. yasm-1.2.0.tar.gz

http://download.csdn.net/detail/zengzhihao/7677671

2. x264-snapshot-20140424-2245.tar.bz2

http://download.csdn.net/detail/zengzhihao/7677707

3. xvidcore-1.1.3.tar.gz

http://download.csdn.net/detail/zengzhihao/7677717

4. SDL-1.2.15.tar.gz

http://download.csdn.net/detail/zengzhihao/7677691

5.  ffmpeg-1.2.2.tar.gz

http://download.csdn.net/detail/zengzhihao/7677745


二.逐个编译上面源文件

/usr/local/ffmpeg_arm:依赖的库文件目录,目标目录,库目录

1. yasm-1.2.0.tar.gz

tar -zxvf yasm-1.2.0.tar.gz && cd yasm-1.2.0 && ./configure --prefix=/usr/local/ffmpeg_arm --host=arm-linux && make&&make install && cd ../


2. x264-snapshot-20140424-2245.tar.bz2

tar -jxvf x264-snapshot-20140424-2245.tar.bz2 && cd x264-snapshot-20140424-2245 && ./configure  --enable-shared --prefix=/usr/local/ffmpeg_arm --host=arm-linux --cross-prefix=arm-linux- --disable-asm && make && make install && cd ../


3. xvidcore-1.1.3.tar.gz

3.1

tar -zxvf xvidcore-1.1.3.tar.gz && cd xvidcore-1.1.3/build/generic

3.2
vi configure
修改$CC为gcc
4361         gcc -o gcc-ver test.c


3.3
./configure --prefix=/usr/local/ffmpeg_arm --host=arm-linux --target=arm-linux && make && make install && cd ../../../


4. SDL-1.2.15.tar.gz

tar -zxvf SDL-1.2.15.tar.gz && cd SDL-1.2.15 && ./configure --enable-shared --prefix=/usr/local/ffmpeg_arm --host=arm-linux  --disable-video-x11 --disable-input-tslib --disable-esd --disable-arts --disable-nasm  --disable-alsa   --disable-video-nanox --disable-video-qtopia --disable-video-photon  --disable-video-ggi --disable-video-svga --disable-video-aalib --disable-video-dummy --disable-video-dga --disable-arts && make && make install && cd ../


5.  ffmpeg-1.2.2.tar.gz

5.1
tar -zxvf ffmpeg-1.2.2.tar.gz && cd ffmpeg-1.2.2 


5.2


vi configure
修改configure的SDL_CONFIG
3973 SDL_CONFIG="${cross_prefix}sdl-config"

3973 SDL_CONFIG="/usr/local/ffmpeg_arm/bin/sdl-config"




5.3
 ./configure --cross-prefix=/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux- --prefix=/usr/local/ffmpeg_arm --enable-shared --enable-cross-compile --arch=armv7   --target-os=linux --cc=arm-linux-gcc --enable-libxvid --enable-libx264 --enable-gpl --enable-pthreads   --disable-ffserver --enable-ffmpeg --disable-ffprobe --enable-ffplay  --enable-avfilter --disable-network  --enable-runtime-cpudetect --disable-indevs --ar=arm-linux-ar --ld=arm-linux-gcc --strip=arm-linux-strip --extra-cflags=-I/usr/local/ffmpeg_arm/include --extra-ldflags=-L/usr/local/ffmpeg_arm/lib




5.4 检查ffplay是否包含"CONFIG_FFPLAY=yes" 没有则说明有问题
vi config.mak


CONFIG_FFPLAY=yes


5.5
make && make install



6 拷贝/usr/local/ffmpeg_arm到开发板上运行


7 删除多余的文件

你可能感兴趣的:(总结)