linux下编译支持librtmp、libx264、libfaac的ffmpeg
2015-07-29 17:04
639 查看
下载源码
librtmp http://rtmpdump.mplayerhq.hu/ 我采用的是rtmpdump-2.4libx264 http://download.videolan.org/x264/snapshots/ 我采用的是最新版
libfaac 由于是ubuntu,我当时直接apt-get install libfaac-dev了
yasm http://yasm.tortall.net/Download.html 版本为yasm-1.3.0
ffmpeg http://www.ffmpeg.org/download.html 版本为ffmpge-2.6.3
编译
1. librtmpcd rtmpdump make make install
2. yasm
cd yasm ./configure --prefix=/usr/local/yasm make make install
3. libx264
cd x264 ./configure --prefix=/usr/local/x264 --enable-shared --enable-static --enable-yasm make make install
4. libfaac
apt-get install libfacc-dev
5. ffmpeg
cd ffmpeg ./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-libx264 --enable-gpl --enable-pthreads --extra-cflags=-I/usr/local/x264/include --extra-ldflags=-L/usr/local/x264/lib make make install
可能出现的问题
1. libx264 not found等类似的库找不到–extra-cflags=-I 和 –extra-ldflags 手动指定头文件和库路径
将使用到的库路径添加至PATH中
vim /etc/profile //文件末尾加入下面内容 export PATH=/usr/local/bin:$PATH export PATH=/usr/local/yasm/bin:$PATH export PATH=/usr/local/yasm/lib:$PATH export PATH=/usr/local/x264/bin:$PATH export PATH=/usr/local/x264/include:$PATH export PATH=/usr/local/x264/lib:$PATH export PATH=/usr/local/sbin:$PATH export PATH=/usr/local/bin:$PATH export PATH=/usr/sbin:$PATH export PATH=/sbin:$PATH export PATH=/usr/local/lib:$PATH //保存退出 source /etc/profile ldconfig
2. error while loading shared libraries: libx264.so: cannot open shared object file: No such file
vim /etc/ld.so.conf ... /usr/local/lib /usr/local/x264/lib //添加x264库路径,添加完保存退出 ldconfig
测试
ffmpeg -v //查看ffmpeg版本 ffmepg //测试ffmpeg运行是否缺少库引用 ffmpeg -i 'rtmp://192.168.1.12/live/livestream live=1' -vcodec copy -acodec copy -f flv -y rtmp://192.168.1.12/live/livestream1 //测试ffmpeg是否可以使用librtmp转rtmp流
相关文章推荐
- Linux常用命令大全
- 转载_Linux下Bluetooth编程
- 关于在redhat的linux系统下安装sunjdk问题
- 在Linux系统中使用Gitblit工具创建Git仓库的方法
- Perf -- Linux下的系统性能调优工具,第 2 部分
- Linux磁盘分区简介及分区
- 很少人知道的Linux命令
- Linux下的定时器
- linux中send函数MSG_NOSIGNAL异常消息
- linux中解决SSH连接慢问题
- Perf -- Linux下的系统性能调优工具,第1部分
- linux 中 ‘|’的作用
- ARM嵌入式linux系统学习之裸机(一)
- linux中文显示乱码问题
- Linux C中的编码转换(文件中文输出)
- linux下imagemagick批量处理图片命令
- 【linux高级程序设计】(第十一章)System V进程间通信 2
- linux中搜索文件中某字符串
- linux下jboss启动配置参数
- Linux的五个查找命令:find,locate,whereis,which,type