Welcome! Log In Create A New Profile

Advanced

Allow someone to watch a livestream from the beginning if he tunes in late

Posted by mahaju 
Allow someone to watch a livestream from the beginning if he tunes in late
September 14, 2020 12:05AM
Hello
I am mostly trying to understand the basics of livestreaming using nginx. I need to create a livestreaming nginx server running on CentOS, where is someone tunes in to the live stream late, he has to watch the stream from the beginning, while others that had tuned in when the stream started can continue watching live. For example,

1:00 -> stream starts (and runs for 2 hours, upto 2:00)
Someone watching from 1:00 watches for 1 hour, stream ends at 2:00
Someone comes in at 1:30, but watches the video from the beginning, that is, starting from what was being streamed at 1:00
He watches for 1 hour, for him the stream ends at 2:30

Is something like this possible using nginx? Can this be done just by changing the nginx.conf files, or would it require something more complex? How easy or difficult would this be?

My current setup:
I have CentOS 8.2 with nginx installed. I compiled from source using the instructions here:
https://www.nginx.com/blog/video-streaming-for-remote-learning-with-nginx/

Before installing, I used checkinstall to create a package instead of using sudo make install as instructed. Nginx is installed successfully. I was not able to properly stream using HLS and DASH as instructed in the website linked above, since I kept getting error in the nginx.conf file. I was able to get a basic stream using instructions given here:
https://opensource.com/article/19/1/basic-live-video-streaming-server

On my windows client I am running OBS studio with an mp4 file as a video source. I stream to the nginx server with this setting:
rtmp://192.168.0.xx/live
Stream key: 1

I am using VLC to receive the stream using this setting:
rtmp://192.168.0.xx/live/1

As of now, when I tune in to the stream I start seeing the exact point where the streaming source is at, with a little lag (for example, if the source is at 1 min 42 sec, I see 1 min 38 sec in VLC). I would like to start seeing this from 00:00 when I tune in to the stream.

Is it possible to do this using only changes to nginx.conf, and if not, what should I be looking in to find out how to do this?
I install this virsion nginx 1.19.3.1 Unicorn and i try to start it from cmd but i don't now if it's really start how can i start the localhost
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 51
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready