由于使用了1.0以下版本的ffmpeg,结合pjsip进行视频通话时经常遇到视频卡死现象
pjsip推荐使用的是libyuv + openh264(openh264目前只能用1.0.0版本的,因为master版本的接口名称改了导致编译无法通过)
但是libyuv + openh264出现了花屏的现象,怀疑是libyuv的问题,但时间比较急,所以又打算用回ffmpeg + x264
ffmpeg使用1.2.9(pjsip说了不支持2.x版本的),x264使用的是stable 版本的
1、先编译x264
In order to quickly compile your libx264, you can type the following commands in your shell:
# cd /my/path/where/i/keep/compiled/stuff # git clone git://git.videolan.org/x264.git # cd x264 # ./configure --enable-static --enable-shared # make # make install # ldconfig
If you get a message like this:
Found yasm 0.x.x.xxxx Minimum version is yasm-1.0.0 If you really want to compile without asm, configure with --disable-asm.
that means that you have an old version of yasm on your system, so you should update it. The quickest way to do so is like this:
# git clone git://github.com/yasm/yasm.git # cd yasm # ./autogen.sh # ./configure # make # make install
(直接下载yasm的exe,然后放在mingw的msys的bin目录下就可以了)
and after that, just repeat the configure, make, and make install steps for libx264 and it should be fine this time.
2、编译ffmpeg
-
# cd /my/path/where/i/keep/compiled/stuff # git clone git://source.ffmpeg.org/ffmpeg.git # cd ffmpeg # ./configure --enable-gpl --enable-libx264 --extra-cflags='-I /usr/local/include' --extra-ldflags='-L /usr/local/lib' # make # make install # ldconfig