Open Khalid-Alqahtani opened 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.
then what I should use for low latency
also what I want is to start play from latest segment available
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.
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