转载自:http://blog.sina.com.cn/s/blog_75992b660101mlfo.html
一、安装好Linux的虚拟机。
二、更新系统软件
三、安装git,并且拉取最新ffmpeg源代码
四、编译ffmpeg
[michael@localhost /]$ ll /usr/local/lib
total 69676
-rw-r--r--. 1 root root 51473968 May 9 16:48 libavcodec.a
-rw-r--r--. 1 root root 582964 May 9 16:48 libavdevice.a
-rw-r--r--. 1 root root 1855462 May 9 16:48 libavfilter.a
-rw-r--r--. 1 root root 15274554 May 9 16:48 libavformat.a
-rw-r--r--. 1 root root 219562 May 9 16:48 libavresample.a
-rw-r--r--. 1 root root 576360 May 9 16:48 libavutil.a
-rw-r--r--. 1 root root 189182 May 9 16:48 libswresample.a
-rw-r--r--. 1 root root 1157418 May 9 16:48 libswscale.a
drwxr-xr-x. 2 root root 4096 May 9 16:48 pkgconfig
[michael@localhost /]$
[michael@localhost /]$ ll /usr/local/include/
total 32
drwxr-xr-x. 2 root root 4096 May 9 16:48 libavcodec
drwxr-xr-x. 2 root root 4096 May 9 16:48 libavdevice
drwxr-xr-x. 2 root root 4096 May 9 16:48 libavfilter
drwxr-xr-x. 2 root root 4096 May 9 16:48 libavformat
drwxr-xr-x. 2 root root 4096 May 9 16:48 libavresample
drwxr-xr-x. 2 root root 4096 May 9 16:48 libavutil
drwxr-xr-x. 2 root root 4096 May 9 16:48 libswresample
drwxr-xr-x. 2 root root 4096 May 9 16:48 libswscale
[michael@localhost /]$
[michael@localhost /]$ ll /usr/local/include/libavformat/
total 92
-rw-r--r--. 1 root root 71469 May 9 16:48 avformat.h
-rw-r--r--. 1 root root 16168 May 9 16:48 avio.h
-rw-r--r--. 1 root root 2858 May 9 16:48 version.h
[michael@localhost /]$
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libavutil/avutil.h"
#include "stdio.h"
int main(int argc, char* argv[])
{
}
gcc -o test ./shortest.c -lavformat -lavcodec -lavutil -lz -lm -lpthread -lbz2
六、总结