树莓派编译nginx,支持rtmp直播
- 树莓派3B+
- 系统更新至最新
- 下载依赖
sudo apt-get update
sudo apt-get install libxslt1-dev libgd-dev libgeoip-dev libpam0g-dev git-core libpcre3-dev libssl-dev git-core vim
- 下载源代码
本来应该到官网去下载的,需要添加rtmp模块,为了方便操作,我将模块和nginx源码整合了
git clone https://git.dev.tencent.com/BDZNH/nginx.git
mkdir -p /var/lib/nginx/body
mkdir -p /var/lib/nginx/fastcgi
mkdir -p /var/lib/nginx/proxy
mkdir -p /var/lib/nginx/scgi
mkdir -p /var/lib/nginx/uwsgi
- 编译
cd nginx/
./configure \
--with-cc-opt='-g -O2 -fdebug-prefix-map=./=. -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' \
--with-ld-opt='-Wl,-z,relro -Wl,-z,now' \
--sbin-path=/usr/bin/ \
--prefix=/usr/share/nginx \
--conf-path=/etc/nginx/nginx.conf \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--lock-path=/var/lock/nginx.lock \
--pid-path=/run/nginx.pid \
--modules-path=/usr/lib/nginx/modules \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--with-debug \
--with-pcre-jit \
--with-ipv6 \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_auth_request_module \
--with-http_v2_module \
--with-http_dav_module \
--with-http_slice_module \
--with-threads \
--with-http_addition_module \
--with-http_geoip_module=dynamic \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_image_filter_module=dynamic \
--with-http_sub_module \
--with-http_xslt_module=dynamic \
--with-stream=dynamic \
--with-stream_ssl_module \
--with-mail=dynamic \
--with-mail_ssl_module \
--add-dynamic-module=./debian/modules/nginx-auth-pam \
--add-dynamic-module=./debian/modules/nginx-dav-ext-module \
--add-dynamic-module=./debian/modules/nginx-echo \
--add-dynamic-module=./debian/modules/nginx-upstream-fair \
--add-dynamic-module=./debian/modules/ngx_http_substitutions_filter_module \
--add-module=./debian/modules/nginx-rtmp-module
make -j4 && sudo make install
4.配置
将以下内容添加到"/etc/nginx/nginx.conf"
rtmp {
server {
listen 1935;
application live {
live on;
}
}
}
- 使用
sudo nginx -t
输出都为ok的时候表示可以用了,去 http://www.ffmpeg.org/download.html 下载好ffmpeg,使用命令
ffmpeg -re -i "source.mp4" -c copy -f flv "rtmp://pi_ip:1935/live"
即可推流
使用 potplayer 或者 vlc player ,从"rtmp://pi_ip:1935/live" 即可串流
树莓派编译nginx,支持rtmp直播的更多相关文章
- 编译Nginx支持Tcp_warppers
Tcp wrappers : Transmission Control Protocol (TCP) Wrappers 为由 inetd 生成的服务提供了增强的安全性.TCP Wrappers 是一种 ...
- 搭建rtmp直播流服务之1:使用nginx搭建rtmp直播流服务器(nginx-rtmp模块的安装以及rtmp直播流配置)
欢迎大家积极开心的加入讨论群 群号:371249677 (点击这里进群) 一.方案简要 首先通过对开发方案的仔细研究(实时监控.流媒体.直播流方案的数据源-->协议转换-->服务器--&g ...
- 基于nginx的rtmp直播服务器(nginx-rtmp-module实现)
首先,在搭建服务之前先了解下目前主流的几个直播协议: 1.RTMP: 实时消息传输协议,Real Time Messaging Protocol,是 Adobe Systems 公司为 Flash 播 ...
- Nginx 搭建rtmp直播服务器
1.到nginx源码目录新建个rtmp目录 ,进入 git clone https://github.com/arut/nginx-rtmp-module.git 2.重编译nginx 代码如下 ...
- 让你的 Nginx 的 RTMP 直播具有统计某频道在线观看用户数量的功能
你的 Nginx 已经有了 RTMP 直播功能的话,如果你还想统计某直播频道当前观看用户量的话,可以加入 with-http_xslt_module 模块.具体步骤如下: 1.查看原来的 ...
- 公布一个软件,轻新视频录播程序,H264/AAC录制视音频,保存FLV,支持RTMP直播
已经上传到CSDN,下载地址:http://download.csdn.net/detail/avsuper/7421647,不要钱滴,嘿嘿... 本程序能够把摄像头视频和麦克风音频,录制为FLV文件 ...
- 实时监控、直播流、流媒体、视频网站开发方案流媒体服务器搭建及配置详解:使用nginx搭建rtmp直播、rtmp点播、,hls直播服务配置详解
注意:这里不会讲到nginx流媒体模块如何安装的问题,只研究rtmp,hls直播和录制相关的nginx服务器配置文件的详细用法和说明.可以对照这些命令详解配置nginx -rtmp服务 一.nginx ...
- ubuntu 上采用nginx做rtmp 直播 服务器
首先安装必要的依赖库 sudo apt-get install autoconf automake sudo apt-get install libpcre3 libpcre3-dev 安装 ...
- CentOS6下基于Nginx搭建mp4/flv流媒体服务器(可随意拖动)并支持RTMP/HLS协议(含转码工具)
1.先添加几个RPM下载源 1.1)安装RPMforge的CentOS6源 [root@AY130611215205Z ~]# wget -c http://pkgs.repoforge.or ...
随机推荐
- POJ3623 Best Cow Line, Gold 【后缀数组】
最好的牛线,金 时间限制: 5000MS 内存限制: 65536K 提交总数: 5917 接受: 2048 描述 FJ即将把他的ñ(1≤ ñ ≤30,000)头牛竞争一年一度的"年度 ...
- 工具——SVN常用命令
SVN一般都是团队合作做一个项目所需用到的,为了是版本的统一 ;1. Check out——从服务器端取得代码 把服务器资料库里存放的某个项目代码取出来,放到本地主机中,这个动作叫做“check ...
- 《软件调试的艺术》学习笔记——GDB使用技巧摘要
<软件调试的艺术>学习笔记——GDB使用技巧摘要 <软件调试的艺术>,因为名是The Art of Debugging with GDB, DDD, and Eclipse. ...
- BZOJ_day???
哇哈哈哈哈,这周能不能保持这个呢?
- 线程--promise furture 同步
http://www.cnblogs.com/haippy/p/3279565.html std::promise 类介绍 promise 对象可以保存某一类型 T 的值,该值可被 future 对象 ...
- 关于session variables 和 global variables
背景 有同学问到这样一个问题:原来的binlog格式是statement,为什么执行了 set global binlog_format='row' 和 set binlog_format='row' ...
- Ubuntu pppoe 拨号上网
-------------蓝色是终端里面的连接方式,可以不看--------------------- ADSL上网,Ubuntu下是可以的,虽然以前没用过拨号上网,不过查了查也不是很麻烦. 打开终端 ...
- BZOJ 2095: [Poi2010]Bridges
2095: [Poi2010]Bridges Time Limit: 10 Sec Memory Limit: 259 MBSubmit: 869 Solved: 299[Submit][Stat ...
- 【HDU5772】String Problem [网络流]
String Problem Time Limit: 10 Sec Memory Limit: 64 MB[Submit][Status][Discuss] Description Input Ou ...
- 【Foreign】猜测 [费用流]
猜测 Time Limit: 10 Sec Memory Limit: 256 MB Description Input Output Sample Input 3 1 1 1 2 2 1 Samp ...