I am presently using ffmpeg to pull a stream from a camera using RTSP, and then output it as an HLS stream. I also have a webpage with a video.js player, using the example code found on this page.
My full ffmpeg command is as follows:
ffmpeg -rtsp_transport tcp -fflags nobuffer -i rtsp://my_rtsp_url_here -c copy -f hls -hls_base_url http://my_base_url_here/ -hls_time 2 -hls_list_size 8 -hls_flags delete_segments stream.m3u8
(As you can see, I've already done some things in an attempt to reduce latency, such as setting -fflags nobuffer.)
Currently, latency seems to be sitting at at least 12 seconds, though I don't have an exact measure. I would be interested in any suggestions for reducing latency, even if that means switching protocols. The only requirement is that I'd like to be able to serve this stream on a webpage.
I suspect that reducing video.js' buffer might help, but I don't know how to go about doing that.