zoukankan      html  css  js  c++  java
  • 流媒体技术学习笔记之(二)RTMP和HLS分发服务器nginx.conmf配置文件(解决了,只能播放RTMP流而不能够播放HLS流的原因)

    user www www;
    worker_processes  1;
    
    error_log  logs/error.log  debug;
    
    #pid        logs/nginx.pid;
    
    events {
        worker_connections  65535;
    }
    
    rtmp {
        server {
            listen 1935;
    
            application live {
                    live on;
                    record off;
            }
    
            application live2 {
                    live on;
                    record off;
            }
    
           # application hls {  #这一块的注释,不然的话.m3u8流是没办法播放的
           #    live on;
                hls on;
                hls_path /tmp/hls;
            #    hls_cleanup off;
            # }
    
        }
    }
    
    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  65;
    
        server
            {
            listen       80;
            server_name  localhost;
    
            location /rtmp/stat {
                rtmp_stat all;
                rtmp_stat_stylesheet rtmpstat.xsl;
            }
    
            location /rtmpstat.xsl {
            }
    
            location /rtmp/control {
                rtmp_control all;
            }
    
            location /hls{
                types {
                    application/vnd.apple.mpegurl m3u8;
                }
                root /tmp;
                add_header Cache-Control no-cache;
                add_header Access-Control-Allow-Origin *;
            }
    
            #控制rtmp模块
            location /control {
                rtmp_control all;
            }
        }
    
    }

    参照网址:

    rtmp与hls流媒体服务器搭建:ubuntu下Nginx搭建初探与rtmp-module的添加

    https://my.oschina.net/joshuashaw/blog/516015

    nginx-rtmp-module 指令详解

    http://blog.csdn.net/aoshilang2249/article/details/51483814

  • 相关阅读:
    Ubuntu16安装chrome
    Ubuntu桌面消失
    Keras读取保存的模型时, 产生错误[ValueError: Unknown activation function:relu6]
    MATLAB字符串分解, 合并
    Pycharm+任务栏悬浮+docked mode
    tfrecords转np.array
    TensorFlow+restore读取模型
    tfrecords转图片存储
    Lenet车牌号字符识别+保存模型
    spring boot日志配置
  • 原文地址:https://www.cnblogs.com/tinywan/p/5915543.html
Copyright © 2011-2022 走看看