Linux / 嵌入式 · 2022-03-18

Linux下MIPS平台交叉编译FFmpeg库

1.下载ffmpeg库的源代码

 (
http://sourceforge.net/project/showfiles.php?group_id=205275&package_id=248632):

 [root@localhost ffmpeg]# ls

 ffmpeg-laster.tar.gz

 2.解压:

 [root@localhost ffmpeg]# tar zxvf ffmpeg-laster.tar.gz 

 3.开始配置,并编译:

 [root@localhost ffmpeg]# mkdir /opt/ffmpeg

 [root@localhost ffmpeg]# cd ffmpeg

 [root@localhost ffmpeg]# ./configure --enable-cross-compile --target-os=linux --cross-prefix=mips-linux-gnu- --cc=mips-linux-gnu-gcc --enable-shared --arch=mips --prefix=/opt/ffmpeg

 [root@localhost ffmpeg]# make

 [root@localhost ffmpeg]# make install

 [root@localhost ffmpeg]# cd ../ffmpeg-release

 [root@localhost ffmpeg-release]# tar -zcvf ffjpeg_lib.tar.gz ./lib

 

板子上运行:
# cp ffjpeg_lib.tar.gz /usr/local/lib/
# cd /usr/local/lib/
# tar -zxvf ffjpeg_lib.tar.gz -C ../
# rm ffjpeg_lib.tar.gz

# cp ffmpeg-release/bin/* /bin/
# ffmpeg
FFmpeg version SVN-r21694, Copyright (c) 2000-2010 Fabrice Bellard, et al.
built on Nov 17 2012 02:25:17 with gcc 4.5.3
configuration: –enable-cross-compile –target-os=linux –cross-prefix=mipsel-linux- –cc=mipsel-linux-gcc –enable-shared –arch=mips –prefix=/opt/ffmpeg
libavutil     50. 9. 0 / 50. 9. 0
libavcodec    52.52. 0 / 52.52. 0
libavformat   52.51. 0 / 52.51. 0
libavdevice   52. 2. 0 / 52. 2. 0
libswscale     0.10. 0 /  0.10. 0
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…

Use -h to get full help or, even better, run ‘man ffmpeg’
#

到现在为止, 我们就成功的将 ffmpeg 移植到我们的开发板上了。