需要安装yasm编译器。http://yasm.tortall.net/Download.html yam下载地址。
见http://wenku.baidu.com/view/8a6b9fef0975f46526d3e107.html 介绍ffmpeg的安装。(其中SVN上的源码为2011-1-19,官方已经不再对SVN进行更新,建议使用git)
http://www.linuxeden.com/html/softuse/20100303/70901.html Ubuntu下Ffmpeg编译及实现流播放总结
http://blog.youkuaiyun.com/fontlose/article/details/6328191 FFMPEG安装() (注:在安装faac前需要安装autoconf automake libtool ;可能会出现权限不足,需要在root下安装.)
./configure --enable-gpl --enable-nonfree --enable-pthreads --enable-libfaac --enable-libfaad --enable-libMP3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopencore-amrnb --enable-version3
1.使用git获取代码
去http://ffmpeg.org/download.html下载
git clone CLONE_URL ffmpeg
去ubuntu软件中心下载yasm编译器(选择那个没有1的)
2.安装ffmpeg
./configure --prefix=/usr && make -j4 install
3.在QT中使用ffmpeg
因为QT是C++环境,ffmpeg是C环境需要加入以下代码:
extern "C" {
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#include <libavformat/avformat.h>
}
#endif
在.pro文件中加入
LIBS += -L /usr/lib
LIBS += -lavcodec
LIBS += -lavdevice
LIBS += -lavformat
LIBS += -lavutil
LIBS += -lswscale
ffmpeg的使用:http://apt-blog.net/using_ffmpeg_api