zoukankan      html  css  js  c++  java
  • 安装nginx-rtmp-module模块与配置

    下载并解压模块:

    wget https://github.com/arut/nginx-rtmp-module/archive/master.zip
    unzip  master.zip

    停止运行的Nginx服务:

    nginx -s stop

    配置并编辑:

    ./configure --add-module=/home/nginx-rtmp-module-master
    make
    make install

    复制Nginx:

    ## 路径根据自己软件路径自行配置
    cp /home/build/nginx-1.11.2/objs/nginx /usr/local/nginx/sbin

    配置rtmp服务:

    rtmp {                #RTMP服务
        server {
           listen 1935;  #//服务端口
           chunk_size 4096;   #//数据传输块的大小
           application vod {
               play /opt/video; #//视频文件存放位置。
           }
           application live{ #直播开启
               live on;
           }
       }
    }

    检查并启动服务:

    nginx -t
    nginx

    另附我自己用来测试的配置文件,5个输出

    worker_processes  1;
    
    error_log  logs/error.log debug;
    
    events {
        worker_connections  1024;
    }
    
    rtmp {
        server {
            listen 1935;
    
                    application live1 {
                live on;
            }
    		
    		application live2 {
                live on;
            }
    		
    		application live3 {
                live on;
            }
    		
    		application live4 {
                live on;
            }
    		
    		application live5 {
                live on;
            }
    		
    		
            application hls {
                live on;
                hls on;  
                hls_path temp/hls;  
                hls_fragment 8s;  
            }
    		
    		
        }
    	
    }
    
    http {
        server {
            listen      80;
    		
            location / {
                root html;
            }
    		
            location /stat {
                rtmp_stat all;
                rtmp_stat_stylesheet stat.xsl;
            }
    
            location /stat.xsl {
                root html;
            }
    		
            location /hls {  
                #server hls fragments  
                types{  
                    application/vnd.apple.mpegurl m3u8;  
                    video/mp2t ts;  
                }  
                alias temp/hls;  
                expires -1;  
            }  
        }
    }
    
    学习时的痛苦是暂时的 未学到的痛苦是终生的
    本文版权归作者和博客园共有,欢迎转载,但必须给出原文链接,并保留此段声明,否则保留追究法律责任的权利。
  • 相关阅读:
    mysql日志
    MYSQL-事务中的锁与隔离级别
    MYSQL事务的日志
    Innodb核心特性-事务
    Innodb存储引擎-表空间介绍
    innodb存储引擎简介
    MYSQL之存储引擎
    MYSQL之索引配置方法分类
    MYSQL之索引算法分类
    MYSQL之select的高级用法
  • 原文地址:https://www.cnblogs.com/juanxincai/p/12886598.html
Copyright © 2011-2022 走看看