• 物流-门店监控-在线直播系统搭建-nginx核心部分


     在线直播还是挺容易搭建的,入门很容易。

    按段分成:推流------>转----->拉流

    本次搭建的:

    • OBS Studio对应到推流部分
    • nginx+rtmp-module对应到转部分(ffmpeg推后再介绍)
    • VLC对应拉流部分

    先自行下载nginx以及rtmp包:

    1. http://nginx.org/download/nginx-1.18.0.tar.gz
    2. https://codeload.github.com/arut/nginx-rtmp-module/zip/master

    搭建命令行:

    [root@iZuf6e0il1e05m6rdx5sx4Z sbin]# history
        1  ll
        2  unzip
        3  yum install unzip
        4  unzip
        5  ll
        6  unzip nginx-1.18.0.tar.gz 
        7  ll
        8  unzip nginx-rtmp-module-master.zip 
        9  ll
       10  tar -xvzf nginx-1.18.0.tar.gz 
       11  ll
       12  cd nginx-1.18.0
       13  ll
       14  ./configure --add-module=/root/nginx-rtmp-module-master
       15  ./configure --add-module=/root/nginx-rtmp-module-master  --prefix=/opt/nginx 
       16  make
       17  make install
       18  pwd
       19  ll
       20  pwd
       21  cd /opt/nginx
       22  ll
       23  cd sbin/
       24  ll
       25  nginx
       26  ./nginx
       27  ./nginx -s reload
       28  history
    ---------------------------------------------------------------------------
    [root@iZuf6e0il1e05m6rdx5sx4Z conf]# cat nginx.conf
    
    #user  nobody;
    worker_processes  1;
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
    
        server {
            listen       80;
            server_name  localhost;
    
            location / {
                root   html;
                index  index.html index.htm;
            }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    }
    
    
    rtmp {
    
        server {
    
            listen 1935;
    
            chunk_size 4000;
    
            # TV mode: one publisher, many subscribers
            application mytv {
    
                # enable live streaming
                live on;
                hls on;
                hls_path /tmp/av;
                hls_fragment 5s;
    
                allow publish all;
            }
        }
    }
    

      

    用OBS Studio做录像以及推流工具,关键配置如下:

     

    VLC拉流,关键配置如下:

     

    搞定

  • 相关阅读:
    cs硕士妹子找工作经历【阿里人搜等互联网】
    EJB到底是什么,真的那么神秘吗??
    到底EJB是什么
    安全性测试:
    掌握 Promise 的逻辑方法
    VS2019 不能下载的解决办法
    Java8基础系列-Stream
    周期模型(典型的几种):
    软件生存周期及其模型是什么?
    试述软件的概念和特点?软件复用的含义?构件包括哪些?
  • 原文地址:https://www.cnblogs.com/aarond/p/online.html
Copyright © 2020-2023  润新知