Using nginx to build and deploy live streaming media server

Time:2022-5-5

Using nginx to build and deploy live streaming media server

Live broadcasting is now an old-fashioned problem. How to use it for live broadcasting? Most people only know that the boss has a live broadcasting software on a platform. Click start to live broadcasting. So how to build a simple live broadcast platform? It only has the live broadcast function, and does not involve transcoding and playback software.

Install nginx and RTMP modules

[email protected]:~# apt install nginx
[email protected]:~# apt install libnginx-mod-rtmp

Modify the configuration to support RTMP
[email protected]:~# vim /etc/nginx/nginx.conf
rtmp {
    server {
        listen 1935;
        chunk_size 4096;
        application live {
            live on;
        }
    }
}

Check whether there are errors
[email protected]:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[email protected]:~# 

Restart nginx
[email protected]:~# systemctl restart nginx

Use OBS live broadcast tool for streaming operation

RTMP: / / < your domain name or IP >: 1935 / live

Using nginx to build and deploy live streaming media server

Using VLC to play streaming

Using nginx to build and deploy live streaming media server

View effect

Using nginx to build and deploy live streaming media server

https://www.oiox.cn/

https://www.chenby.cn/

https://cby-chen.github.io/

https://weibo.com/u/5982474121

https://blog.csdn.net/qq_3392…

https://my.oschina.net/u/3981543

https://www.zhihu.com/people/…

https://segmentfault.com/u/hp…

https://juejin.cn/user/331578…

https://space.bilibili.com/35…

https://cloud.tencent.com/dev…

https://www.jianshu.com/u/0f8…

https://www.toutiao.com/c/use…

CSDN, GitHub, Zhihu, Kaiyuan China, Sifu, Nuggets, Jianshu, Tencent cloud, BiliBili, today’s headlines, Sina Weibo, personal blog and Xiaochen operation and maintenance can be found on the whole network