The delay is inevitable. HLS is not a real time streaming protocol. All it does is break your feed up into little chunks, and sends those over HTTP for your browser to consume. The delay can be reduced by manipulating the “I Frame” interval on your cameras if they have the option like my HikVisions do.
I guess where we are in a bit of disagreement is the overall usefulness of the delay. With the MJPEG stream, by the time i got a notification, was able to open the app on my phone, and loaded the camera stream, 99% of the time the subject of interest was gone.
It all depends on perspective. You are welcome to turn the component off and go back to the old method.
here is what I’m seeing notice the still image is current, but when I click on it to start the stream (preloaded) it shows an old segment from 8:06pm last night, and then just spins.
(my Lab is 14.5+ and has a lot of accidents any more so…)
The delay can be adjusted by the segment length and playlist size. Could we have these exposed as variables? The big win for me on this component is the ability to cast to my Apple TVs.
A 2 second segment (I believe the smallest recommended) size can result in a 6s delayed stream for example. I wasn’t able to dig up what the current segment size and playlist size are currently being used.
We are only reformatting the feed that comes from your camera. We are not transcoding, because that would take way too many resources. All settings need to be adjusted on the feed coming from the camera directly, which is what I said before.
The way the stream component works is it cuts each segment at every keyframe (I-Frame). We do that because of the way h264 encoding works. Each keyframe has the full image, and subsequent frames are just the pixel difference from the keyframe.
Since we are not transcoding, we can not create new keyframes, and therefore can not adjust segment length. Some cameras provide the ability to adjust the interval in which it sends keyframes. That is the only way to reduce the delay at this point in time.
so you are experiencing the exact same issue described in the bug linked, if you look at my latest comment you can see that I was able to reproduce this by just disconnecting the camera while the stream is up.
I have what is probably a dumb question. Why would someone not want to load the latest version of javascript? in otherwords, why is this not just the default HA process?
The problem was that I have an android tv with chromecast built-in that has two media player components, one for the tv and one for the chromecast, and I was trying to stream to the tv and not to the chromecast.