ffmpeg+x264编译

来源:互联网 发布:淘宝店怎么样 编辑:程序博客网 时间:2024/05/21 02:48

1、X264编译(将x264放在ffmpeg下面,不为什么)
./configure --prefix=/usr/local/x264 --enable-shared --enable-static --enable-yasm
make
make install

2、ffmpeg编译
./configure --prefix=./build --enable-shared --enable-yasm --enable-libx264 --enable-gpl --enable-pthreads --extra-cflags=-I/usr/local/x264/include --extra-ldflags=-L/usr/local/x264/lib

make
make install

生成ffmpeg的库、头在build下,注意应用程序调用ffmpeg的库时记得添加/home/shengdn/bak/ffmpeg-0.7-rc1/x264/libx264.a

 

放到应用程序里可能会提示缺东西

譬如我遇到没有定义U_INT64,那么自己声明一个就好

typedef unsigned long long int U_INT64

编译仍提示一堆函数没有定义,看样子像是一些数学上的东西,如下所示即其中之一

ffmpeg-0.7-rc1/libavcodec/pngenc.c:199: undefined reference to `crc32'

则添加 -lm -lz。

 

分别在64位和32为ubuntu下编译过,64位提示重复声明,32位提示未声明,

反正重复声明就删除重复的地方,未声明就添加声明。
0 0
原创粉丝点击