How To create a Video Streaming Server using Nginx-RTMP

preview_player
Показать описание
There are many use cases for streaming video. Service providers such as Twitch are very popular for handling the web discovery and community management aspects of streaming, and free software such as OBS Studio is widely used for combining video overlays from multiple different stream sources in real time. While these platforms are very powerful, in some cases you may want to be able to host a stream that does not rely on other service providers.

In this tutorial, you will learn how to configure the Nginx web server to host an independent RTMP video stream that can be linked and viewed in different applications. RTMP, the Real-Time Messaging Protocol, defines the fundamentals of most internet video streaming.

Commands Used
STEP 1
sudo apt update
sudo apt install libnginx-mod-rtmp
WRITE IN
rtmp {
server {
listen 1935;
chunk_size 4096;
allow publish 127.0.0.1;
deny publish all;

application live {
live on;
record off;
}
}
}

sudo ufw allow 1935/tcp

STEP 2
sudo apt install python3-pip
sudo pip install youtube-dl
youtube-dl address -f mp4
sudo apt install ffmpeg
ffmpeg -re -i "VIDEO NAME" -c:v copy -c:a aac -ar 44100 -ac 1 -f flv rtmp://localhost/live/stream

Useful Links
Рекомендации по теме
Комментарии
Автор

how to play live straeaming on my website usin m3u8 links ? where to get m3u8m link ?

ahmadbashir
Автор

video is not visible on VLC player only audio is hearable

threadRunnable