arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.38k stars 3.51k forks source link

View HLS content from newest segment #1394

Open Khalid-Alqahtani opened 5 years ago

Khalid-Alqahtani commented 5 years ago

Hi I successful stream my webcam using FFmpeg and nginx rtmp module

but what I want is to the view HLS from the newest segment not from the oldest segment available to reduce the latency

Also, I want to ask if I can clean up the HLS after the stream stopped Thank you

KingHorse2015 commented 5 years ago

HLS is not made for low latency. You can specify the length of the playlist with: hls_playlist_length 9; This gives you 10 to 15 seconds delay on most clients. (Clients are not synchronized) The default is 30 seconds delay. Going lower then 10 seconds is not recommended, because most clients want 3 chunks before playing. You can define the chunk size by the following code: hls_fragment 3

HLS files are by default cleared during the stream, unless you have disabled it. hls_continuous off; This is the right setting to automatically clean the files. Of course you also can clean them by your self.

Khalid-Alqahtani commented 5 years ago

then what I should use for low latency

Khalid-Alqahtani commented 5 years ago

also what I want is to start play from latest segment available

KingHorse2015 commented 5 years ago

For low latency use the rtmp stream it self from the server. For a webclient is flash required. Or use VLC/MPC-HC to watch the content.

RTMP is not based on cutting the video in chunks like HLS. Some online platforms have FTL(Faster then Light) that protocol is near instant, but requires a good internet connection. But I dont know if that is open source is. But is not in this module for nginx.