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 ...
随机推荐
- php const define 区别有那些呢?
(1) 编译器处理方式不同 define宏是在预处理阶段展开. const常量是编译运行阶段使用. (2) 类型和安全检查不同 define宏没有类型,不做任何类型检查,仅仅是展开. const常量有 ...
- RMAN笔记小结
首先感谢junsansi和leshani两位大师的文笔:我可是好好看了很多遍:这两位哦:我跟你们说:对rman的解说那是相当精彩:文章形如流水,通俗易懂:内容那是入木三分...;好了我也不多说了,反正 ...
- 搭建LAMP
RPM包和源码包存放位置 /usr/local/src 源码包编译安装位置 /usr/local/apache /usr/local/mysql /usr/local/php 默认MySQL 数据库位 ...
- js作用域链与this
this的绑定与function和对象的定义位置无关,是由函数调用时的执行环境所决定的. scope chain是由函数定义时的位置决定的与函数调用时的执行环境无关.
- Discuz! 6.x/7.x 全局变量防御绕过导致命令执行
https://www.secpulse.com/archives/2338.html 模拟register_globals功能的代码,在GPC为off时会调用addslashes()函数处理变量值, ...
- mysql 字段引号那个像单引号的撇号用法
我们知道通常的SQL查询语句是这么写的: select col from table; 这当然没问题,但如果字段名是“from”呢? select from from table; 若真的这么写,必然 ...
- Mysql-学习笔记(==》存储过程 九)
1.存储过程概念在大型数据库系统中,一组为了完成特定功能的sql语句集,经编译后存储在数据库中,用户通过指定存储过程的名字并给出参数(如果该存储过程带有参数)来执行它. 2.建立存储过程delimit ...
- Bootstrap——导航栏编写
<nav class="navbar navbar-default navbar-fixed-top" role="navigation"> ...
- android 入门 002 (拨打电话,发送短信)
一.拨打电话 1.首先做好界面,代码如下: layout =>activity_main.xml 中 <LinearLayout xmlns:android="http://sc ...
- Cpdetector编码识别
概述 浏览器在打开一个网页时,首要任务是判断网页的编码格式,然后采用合适的编码进行解析:我们常用的文本编辑器在打开文档时同样需要判断文档的编码进行相应的解析.这涉及到的技术就是编码甄别,下面我们介绍一 ...