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设计模式 09_ZhuangShiQi.php】装饰器模式 (decorator)
<?php /** * [装饰器模式 (decorator)] * 有时候发布一篇文章需要经过很多人手,层层处理 */ header("Content-type: text/html; ...
- 《深入浅出MFC:》
callback函数必须是static的,才能去除隐藏的this指针.
- 【转】Cookie和Session的区别详解
转载地址:http://www.phperzone.cn/portal.php?aid=541&mod=view 一.cookie机制和session机制的区别 具体来说cookie机制采用的 ...
- Code(组合数学)
Code Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 8766 Accepted: 4168 Description Tran ...
- Check the difficulty of problems
Check the difficulty of problems Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 5830 Acc ...
- N-gram介绍
在实际应用中,我们经常需要解决这样一类问题:如何计算一个句子的概率?如: 机器翻译:P(high winds tonite) > P(large winds tonite) 拼写纠错:P(abo ...
- canvas动画基础
setInterval( function(){ render( context ); update(); } , ); window.requestAnimFrame = (function() { ...
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) A
Description You are given names of two days of the week. Please, determine whether it is possible th ...
- 如何把drawing图像转换成wpf控件的source
此例以canvas为例 <Canvas> <Image Stretch="Fill" Width="100" Height="10 ...
- CALayer的分析
转载地址: http://my.oschina.net/u/2340880/blog/536048 iOS开发CoreAnimation解读之二——对CALayer的分析 一.UIView中的CAL ...