【Linux】Linux下MIPS平台交叉编译FFmpeg库 及使用库截取视频中的某一帧
来源:互联网 发布:175平台数据 编辑:程序博客网 时间:2024/05/29 16:36
一.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 ffmpeg-release
[root@localhost ffmpeg]# cd ffmpeg
[root@localhost ffmpeg]# ./configure --enable-cross-compile --target-os=linux --cross-prefix=mipsel-linux- --cc=mipsel-linux-gcc --enable-shared --arch=mips --prefix=/opt/brcm/ffmpeg/ffmpeg-release
[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/brcm/ffmpeg/ffmpeg-release
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 移植到我们的开发板上了。
二.Linux下使用ffmpeg库:
1.命令行使用:ffmpeg -i test.mp4 -y -f image2 -ss 30 -s 95*95 -vframes 1 a.jpg
找一个MP4文件:test.mp4,然后使用上面的命令就可以取得30秒时视频的图像,保存为
95*95像素的JPG文件。
ffmpeg -i 000094.mp4 -vframes 30 -pix_fmt rgb24 -y -f gif a.gif
把前30帧转化为GIF文件。
2.在程序中调用函数截获视频图片:
首先加入库支持,在我们的可执行程序的Makefile文件中,加入:
CFLAGS += -I/opt/brcm/ffmpeg/ffmpeg-release/include/
LFLAGS += -L/opt/brcm/ffmpeg/ffmpeg-release/lib/ -lavutil -lavformat -lavcodec -lswscale
(记住,后面最后四个参数缺一不可,否则编译不通过)
然后关于在编程中使用FFMPEG库的方法,附带一个成熟的Demo。
(test_snap.c和Makefile)
附带几个我自己看过的网站:
http://ray.imiddle.net/2008/10/ffmpeg-install-and-usage/
http://blog.csdn.net/menuconfig/article/details/2600890
http://bbs.chinaunix.net/thread-1932536-1-1.html
- Linux下MIPS平台交叉编译FFMpeg库 及使用库截取视频中的某一帧
- Linux下MIPS平台交叉编译FFMpeg库 及使用库截取视频中的某一帧
- 【Linux】Linux下MIPS平台交叉编译FFmpeg库 及使用库截取视频中的某一帧
- linux下ffmpeg库 ARM交叉编译
- Ubuntu 14.04 LTS下使用mips-linux-gnu-gcc交叉编译OpenCV所需库
- Linux下ffmpeg交叉编译
- [转载] 在Linux下用buildroot搭建mips/arm的交叉编译平台
- 【Linux】Linux下搭建MIPS交叉编译环境
- Linux下编译Android平台的ffmpeg库
- arm-linux平台下交叉编译使用libxml2
- cdrtools在mips linux交叉编译
- linux下编译使用ffmpeg
- ffmpeg在linux平台下的编译
- linux下交叉编译windows下的ffmpeg
- Linux下构建 MIPS 交叉编译器
- MIPS平台交叉编译zlib
- Linux下编译MIPS compiler
- linux下交叉编译libusb的方法及编译一个使用了libusb库的test程序的方法
- SQLite学习笔记之二
- Vector sort 排序
- StringUtils
- GLIBC内存分配机制引发的“内存泄露”
- SQLite学习笔记之三
- 【Linux】Linux下MIPS平台交叉编译FFmpeg库 及使用库截取视频中的某一帧
- Zebra命令模式分析(二)[补]
- Arduino 入门
- 每日实现一算法之插入排序
- kill 和raise函数
- 错误总结
- struts返回对象json格式数据
- List(T) 的实现实体对象操作,之Find FindAll Contains ForEach Sort
- C++ Style and Technique FAQ (