Nginx 的RTMP打流模块配置
config配置文件:
user www www;
worker_processes ;
error_log logs/error.log debug;
#pid logs/nginx.pid;
events {
worker_connections ;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '[$time_local][$remote_addr][$http_x_forwarded_for] $status "$request" "$http_referer" "$http_user_agent"';
access_log logs/access.log main;
sendfile on;
keepalive_timeout ;
server {
set $wwwroot /home/www/node/html;
listen ;
server_name localhost;
index index.html;
root $wwwroot;
access_log logs/node.access.log main;
location ~ .*\.(js|css)?$ {
expires 2d;
access_log off;
}
#html
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|rar|zip|txt|mid|doc|ppt|pdf|xls)$ {
expires 30d;
access_log off;
}
location /rtmp/stat {
rtmp_stat all;
rtmp_stat_stylesheet rtmpstat.xsl;
}
location /rtmpstat.xsl {
}
location /rtmp/control {
rtmp_control all;
}
location ~* /hls/.*\.m3u8$ {
types {
application/vnd.apple.mpegurl m3u8;
}
root /tmp;
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
}
location ~* /hls/.*\.ts$ {
types {
video/mp2t ts;
}
root /tmp;
expires 1m;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
#error_page /.html;
error_page /50x.html;
location = /50x.html {
root html;
}
location / {
}
#控制rtmp模块
location /control {
rtmp_control all;
}
}
}
rtmp {
server {
listen ;
ping 5s;
timeout 10s;
notify_method get;
drop_idle_publisher 10s;
application live { ##这个是直播节点
live on;
#exec /home/www/amaiStream/streamPushToLiveNode.sh;
exec /home/www/bin/rtmpDispatch.sh $name
exec_kill_signal term;
exec_publish_done /home/www/bin/pubDone.sh $name;
#设置是否保存录像(手动)
recorder rec {
record all manual; #在活动服务器进行录像,手动控制
record_unique on;
record_notify on;
record_max_size 512M;
#record_interval 30s;
record_path /data/recorded_flvs;
record_suffix wsl.flv; #文件的后缀
#录像停止后,先判断是否能上传,允许后则将录像上传到OSS/
#exec_record_done /home/www/bin/rtmpRecorded.sh $name $path $filename $basename $dirname;
}
}
application hls {
live on;
hls on;
hls_path /tmp/hls;
#live, event
hls_type live;
#hls_sync 100ms;
#sequential, timestamp, system
hls_fragment_naming system;
hls_fragment_naming_granularity ;
#plain, aligned
hls_fragment_slicing aligned;
hls_fragment 3s;
#hls_fragment 5s;
hls_playlist_length 15s;
}
}
}
Nginx 的RTMP打流模块配置的更多相关文章
- 搭建rtmp直播流服务之1:使用nginx搭建rtmp直播流服务器(nginx-rtmp模块的安装以及rtmp直播流配置)
欢迎大家积极开心的加入讨论群 群号:371249677 (点击这里进群) 一.方案简要 首先通过对开发方案的仔细研究(实时监控.流媒体.直播流方案的数据源-->协议转换-->服务器--&g ...
- nginx开发(四)调用ffmpeg,搭建rtmp直播流。
1: 修改conf文件,配置rtmp直播 打开usr/local/nginx/conf/nginx.conf,添加红色内容: rtmp {#rtmp点播配置 server { li ...
- 实时监控、直播流、流媒体、视频网站开发方案流媒体服务器搭建及配置详解:使用nginx搭建rtmp直播、rtmp点播、,hls直播服务配置详解
注意:这里不会讲到nginx流媒体模块如何安装的问题,只研究rtmp,hls直播和录制相关的nginx服务器配置文件的详细用法和说明.可以对照这些命令详解配置nginx -rtmp服务 一.nginx ...
- Windows10环境下 Nginx+ffmpeg自搭服务器制作RTMP直播流
Windows10环境下 Nginx+ffmpeg自搭服务器制作RTMP直播流学习笔记 所需条件: nginx-rtmp-module(带rtmp模块) ,链接:https://link.jiansh ...
- Nginx 的 RTMP 模块的在线统计功能 stat 在 multi-worker 模式下存在 Bug
< 让你的 Nginx 的 RTMP 直播具有统计某频道在线观看用户数量的功能>一文介绍了 Nginx 的在线统计模块. 我们的在线直播服务使用了 Nginx 的 Rtmp ...
- OSX安装nginx和rtmp模块(rtmp直播服务器搭建)
1.安装Homebrew,执行命令 1 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/ma ...
- Mac系统安装nginx+rtmp模块
1.安装命令 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install) ...
- 三、直播整体流程 五、搭建Nginx+Rtmp直播流服务
HTML5实现视频直播功能思路详解_html5教程技巧_脚本之家 https://m.jb51.net/html5/587215.html 三.直播整体流程 直播整体流程大致可分为: 视频采集端:可以 ...
- nginx的rtmp搭建流媒体服务器实现直播流
最近自己搞了一个用nginx的rtmp来搭建流媒体服务器,从而实现直播的过程,参考了网上很多资料,有些资料对于初学者来说比较难以理解,在此将我搭建的过程记录下来,分享给大家. 1.下载nginx-rt ...
随机推荐
- Java获取字符串编码方式
直接下载吧: http://files.cnblogs.com/files/xiluhua/BytesEncodingDetectTool.rar
- weblogic .NoClassDefFoundError: Could not initialize class sun.awt.X11Graphi
这个是常见问题,可以通过增加Weblogic的启动参数来解决: -Djava.awt.headless=true 你可以修改 startWebLogic.sh 文件. export JAVA_OPTI ...
- iOS开发 爱特开发技术bug总结
#pragma mark 每天总结学习两小时 效率 和 每天学习 研究底层 多进去看看 // .................................................... ...
- Docker第三方项目小结
软件项目的成功常常根据其催生的生态系统来衡量.围绕或基于核心技术构建的项目增添了功能和易用性,它们常常日臻完善.Docker就是一个典例,有众多第三方项目扩展.补充或改进Docker. •Docker ...
- Codeforces 745C:Hongcow Builds A Nation(并查集)
http://codeforces.com/problemset/problem/744/A 题意:在一个图里面有n个点m条边,还有k个点是受限制的,即不能从一个受限制的点走到另外一个受限制的点(有路 ...
- C++中关于cin、cin.get()、cin.getline()、getline()、gets()等函数的用法
1.cin>> 用法1:最基本,也是最常用的用法,输入一个数字: 注意:>> 是会过滤掉不可见的字符(如 空格 回车,TAB 等) cin>>noskipws> ...
- xcode4.3 完成输入后 点击背景关闭键盘
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self.view endEditing:YES];} 把这个复制到 ...
- JAVA类访问URL
URI uri = new URI("https://www.baidu.com/"); Desktop desktop = null; if (Des ...
- C#相对路径转绝对路径,绝对路径转相对路径
1.绝对路径转相对路径 绝对转相对似乎C#没有提供实现,需要自己写,这里摘选了一位博友的实现方法: string RelativePath(string absolutePath, string re ...
- linux脚本随笔-01
#### 获取配置文件配置路径,javapath为配置项,var为具体的配置值 eval $(awk -F "javapath=" '{if($2=="") { ...