您的位置:首页 > 运维架构 > Linux

pjsip编译步骤,centos环境支持视频通话

2015-08-22 15:30 218 查看
参考:1:http://trac.pjsip.org/repos/wiki/Getting-Started/Autoconf

2:VoIP应用在Ubuntu 14.04下编译FFmpeg libX264及PJSIP(http://www.mr-wu.cn/how-to-compile-ffmpeg-x264-and-pjsip-on-ubuntu-14-04-for-voip/)

1.CentOS版本:CentOS-7-x86_64-DVD-1503-01 pjsip版本:2.4

2.安装编译工具:

yum -y install gcc automake autoconf libtool make

yum install gcc gcc-c++

3.创建工作目录 用来存放使用的库 mkdir /home/toolchain, 源码下载都下载到/usr/local/src 中

4.编译yasm http://yasm.tortall.net/Download.html

./configure -prefix=/home/toolchain/yasm

make && make install

加入环境变量:export PATH=/home/toolchain/yasm/bin:$PATH

5.编译sdl 2.0 http://www.libsdl.org/download-2.0.php
./configure --prefix=/home/toolchain/sdl

make && make install

6.安装Libyuv 我是在webrtc目录下找到的libyuv的源码 拷贝到linux下进行安装

make -f linux.mk

7.编译libx264 http://www.videolan.org/developers/x264.html
./configure --prefix=/home/toolchain/libx264 --enable-shared --enable-static

make && make install

8.编译ffmpeg http://ffmpeg.org/download.html
./configure --prefix=/home/toolchain/ffmpeg --disable-static --enable-shared --enable-memalign-hack --extra-cflags="-I/home/toolchain/libx264/include" --extra-ldflags="-L/home/toolchain/libx264/lib" --enable-gpl --enable-libx264

make && make install



9.编译pjsip

在源码文件config_site.h 添加:#define PJMEDIA_HAS_VIDEO
1

./configure --with-sdl=/home/toolchain/sdl/ --with-ffmpeg=/home/toolchain/ffmpeg/

make dep

make



10.遇到的问题 编译后提示链接错误 找不到x264的函数

sudo vim /etc/ld.so.conf

添加/home/toolchain/ffmpeg/lib保存

执行 sudo ldconfig

再次编译 编译成功

11.如需下载的资源包括编译文档,请下载:http://download.csdn.net/detail/quitehandsome/9035451
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: