需要:
x264的库,直接去下载回来 编译就可以了.
git clone git://git.videolan.org/x264.git
ls
cd x264/
ls
./configure --enable-static --enable-shared
然后去配置
ffmpeg的configure
#!/bin/sh
function build_one {
./configure \
--prefix=$PREFIX \
--cc=clang \
--disable-yasm \
--enable-gpl \
--enable-libx264 \
--extra-cflags=-I/Users/jack/Downloads/ffmpeg/x264/build/include \
--extra-ldflags=-L/Users/jack/Downloads/ffmpeg/x264/build/lib \
}
PREFIX=$(pwd)/build
build_one
注意这个configure指令是不能有空行的,空行一定要用 "\"来接上.
看输出有没有启用了h264库
启用了 就直接make&make install 完成ffmpeg的编译.
使用ffmpeg吧h264 转 MP4
./ffmpeg -i XXX.h264 out.MP4
参考:
http://blog.csdn.net/ljh081231/article/details/7595556
http://blog.shengbin.me/posts/build-ffmpeg-on-os-x/
http://www.cnblogs.com/zenny-chen/archive/2012/04/27/2473780.html
http://blog.csdn.net/simongyley/article/details/9984167
http://blog.csdn.net/leixiaohua1020/article/details/44864509