Nginx-rtmp直播服务器编译配置
来源:互联网 发布:黑暗迪迦官方数据无限 编辑:程序博客网 时间:2024/06/15 12:31
编译
1、 需要的库nginx-rtmp-module,openssl,pcre,nginx。
2、 只需要在nginx运行.configure和make就可以,ningx的编译会自动去编译链接其他库的源码,不需要单独编译其他库。
配置与维护
1、 启动nginx的命令为”sudo nginx的可执行文件”
2、 修改配置文件后不重启nginx使配置生效的方法
(1)”sudo nginx的可执行文件 –t” 测试nginx的配置文件是否有语法错误
(2)”sudo nginx的可执行文件 –r reload”使更改后的配置文件生效。
3、 需要修改的配置文件只有nginx.conf。
4、 修改nginx-rtmp配置语法需要参考的资料
(1)在线官方资料
https://github.com/arut/nginx-rtmp-module/wiki/Examples
https://github.com/arut/nginx-rtmp-module
https://github.com/arut/nginx-rtmp-module/wiki/Directives
(2)nginx-rtmp-module源码目录下的test/nginx.conf文件
5、一些常用配置文件写法
(1)点播服务器
rtmp {
server {
listen 1935;
application vod {
play /var/flvs;
}
}
}
(2)直播服务器
rtmp {
server {
listen 1935;
application live {
live on;
}
}
}
(3)将远程服务器上的流拉到本地,播放时播放rtmp://本机IP/tv/maintv即可。
rtmp {
server {
listen 1935;
application tv {
live on;
pull rtmp://cdn.example.com:443/programs/main name=maintv;
}
}
}
(4)将推到nginx服务器上的流转推到指定地址
rtmp {
server {
listen 1935;
application tv {
live on;
push rtmp://cdn.example.com:443/programs/main;
}
}
}
(5)hls分发
rtmp {
server {
listen 1935;
application tv {
live on;
hls on;
hls_path /tmp/tv2;
hls_fragment 15s;
pull rtmp://tv2.example.com:443/root/new name=tv2;
}
}
}
http {
server {
listen 80;
location /tv2 {
alias /tmp/tv2;
}
}
}
(6)从其他服务器拉流转推到其他服务器
application myapp {
live on;
pull rtmp://100.100.100.100:9023/live/zhejiang live=1 name=zhe static;
on_publish http://127.0.0.1/on_publish2;
}
http {
server {
listen 80;
location /
on_publish2{
rewrite ^.*$ rtmp://192.168.10.10/app/name permanent;
}
}
}
注:在nginx里嵌入ffmpeg时要把ffmpeg放在/usr/bin目录下否则可能找不到
0 0
- Nginx-rtmp直播服务器编译配置
- NGINX配置rtmp服务器实现rtmp以及hls直播
- NGINX配置rtmp服务器实现rtmp以及hls直播
- nginx 搭建rtmp直播服务器
- Ubuntu服务器的配置nginx 简单实现rtmp视频直播
- nginx+nginx-rtmp-module部署直播服务器
- 使用nginx-rtmp搭建视频直播服务器
- Mac上搭建直播服务器Nginx+rtmp
- 使用nginx-rtmp搭建视频直播服务器
- Mac上搭建nginx+rtmp直播服务器
- 树莓派使用nginx+rtmp搭建直播服务器
- Mac上搭建直播服务器Nginx+rtmp
- nginx+rtmp直播流服务器搭建
- ffmpeg + nginx + rtmp 搭建本地直播服务器
- Mac上搭建直播服务器Nginx+rtmp
- 实时监控、直播流、流媒体、视频网站开发方案流媒体服务器搭建及配置详解:使用nginx搭建rtmp直播、rtmp点播、,hls直播服务配置详解
- 实时监控、直播流、流媒体、视频网站开发方案流媒体服务器搭建及配置详解:使用nginx搭建rtmp直播、rtmp点播、,hls直播服务配置详解
- 实时监控、直播流、流媒体、视频网站开发方案流媒体服务器搭建及配置详解:使用nginx搭建rtmp直播、rtmp点播、,hls直播服务配置详解
- 3.23
- java内存泄露和内存溢出(一)
- [Unity实战]详解换装系统(三)
- IOS 开发进阶--网络多线程--内存的结构的基本理解
- 求阶乘值。
- Nginx-rtmp直播服务器编译配置
- 第二章第十题
- 去除继承ActionBarActivity的Activity中的ActionBar
- c语言面试题重点整理·基础类
- Mac中分析hprof文件查找内存泄露
- 用java语言实现单链表
- Linux下的多线程编程
- CocoaPods介绍及使用
- 视图和视图解析器