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打流模块配置的更多相关文章

  1. 搭建rtmp直播流服务之1:使用nginx搭建rtmp直播流服务器(nginx-rtmp模块的安装以及rtmp直播流配置)

    欢迎大家积极开心的加入讨论群 群号:371249677 (点击这里进群) 一.方案简要 首先通过对开发方案的仔细研究(实时监控.流媒体.直播流方案的数据源-->协议转换-->服务器--&g ...

  2. nginx开发(四)调用ffmpeg,搭建rtmp直播流。

    1: 修改conf文件,配置rtmp直播 打开usr/local/nginx/conf/nginx.conf,添加红色内容: rtmp {#rtmp点播配置    server {        li ...

  3. 实时监控、直播流、流媒体、视频网站开发方案流媒体服务器搭建及配置详解:使用nginx搭建rtmp直播、rtmp点播、,hls直播服务配置详解

    注意:这里不会讲到nginx流媒体模块如何安装的问题,只研究rtmp,hls直播和录制相关的nginx服务器配置文件的详细用法和说明.可以对照这些命令详解配置nginx -rtmp服务 一.nginx ...

  4. Windows10环境下 Nginx+ffmpeg自搭服务器制作RTMP直播流

    Windows10环境下 Nginx+ffmpeg自搭服务器制作RTMP直播流学习笔记 所需条件: nginx-rtmp-module(带rtmp模块) ,链接:https://link.jiansh ...

  5. Nginx 的 RTMP 模块的在线统计功能 stat 在 multi-worker 模式下存在 Bug

    < 让你的 Nginx 的 RTMP 直播具有统计某频道在线观看用户数量的功能>一文介绍了 Nginx 的在线统计模块.         我们的在线直播服务使用了 Nginx 的 Rtmp ...

  6. OSX安装nginx和rtmp模块(rtmp直播服务器搭建)

    1.安装Homebrew,执行命令 1 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/ma ...

  7. Mac系统安装nginx+rtmp模块

    1.安装命令 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install) ...

  8. 三、直播整体流程 五、搭建Nginx+Rtmp直播流服务

    HTML5实现视频直播功能思路详解_html5教程技巧_脚本之家 https://m.jb51.net/html5/587215.html 三.直播整体流程 直播整体流程大致可分为: 视频采集端:可以 ...

  9. nginx的rtmp搭建流媒体服务器实现直播流

    最近自己搞了一个用nginx的rtmp来搭建流媒体服务器,从而实现直播的过程,参考了网上很多资料,有些资料对于初学者来说比较难以理解,在此将我搭建的过程记录下来,分享给大家. 1.下载nginx-rt ...

随机推荐

  1. DBLINK的session无法关闭,报异常!

    ------解决方法-------------------------------------------------------- --ALTER SESSION alter session clo ...

  2. Java学习网站

    黑马: http://bbs.itheima.com/forum.php 考试网站: http://www.nowcoder.com/ 牛客网 比较专业的学习技术网站: http://www.ibm. ...

  3. jquery easyui读取json文件乱码

    输出的json要求用utf-8,否则因json的编码格式有问题显示不了中文.记事本默认编码是ANSI,若保存的json是由记事本改后的缀名,则json格式有问题,显示中文为乱码. 解决方法:打开.js ...

  4. mybatis中#{}和${}的区别

    1. #将传入的数据都当成一个字符串,会对自动传入的数据加一个双引号.如:order by #user_id#,如果传入的值是111,那么解析成sql时的值为order by "111&qu ...

  5. Entity Framework 第七篇 简化排序

    上篇介绍了EF的分页实现,分页的时候会用到排序,但是使用起来表达式写的似乎很繁琐 , ); 如果直接使用排序字符串,不更直观简便么? respository.GetPaged<S_Users&g ...

  6. CentOS搭建Redis集群

    集群原理-redis-cluster架构图 架构细节: (1)所有的redis节点彼此互联(PING-PONG机制),内部使用二进制协议优化传输速度和带宽. (2)节点的fail是通过集群中超过半数的 ...

  7. SpringMvc 使用poi导入导出Excel

    Util类 package com.common.util; public class ExportUtil { private XSSFWorkbook wb = null; private XSS ...

  8. winform 发邮件

    System.Net.Mail.SmtpClient client = new SmtpClient("smtp.163.com");   client.UseDefaultCre ...

  9. dubbo源码之一——xml schema扩展

    dubbo源码版本:2.5.4 dubbo-parent |----dubbo-config |----dubbo-config-api |----com.alibaba.dubbo.config.* ...

  10. 调用REST接口获取数据

    /// <summary> /// 根据机构代码本机构下报警用户列表: /// </summary> /// <param name="org_code&quo ...