物流-门店监控-在线直播系统搭建-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

搭建命令行:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
[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拉流,关键配置如下:

 

 

 

搞定

 

posted @   McKay  阅读(197)  评论(0编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
历史上的今天:
2013-08-28 基于MongoDB打造.Net的分布式Session子系统
点击右上角即可分享
微信分享提示