Stream Component: Confirmed Cameras and Configurations

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.

1 Like

I have a total of 10 Hikvision cameras via 2 NVRs (one via VPN) and occasionally I see following errors:

Error demuxing stream: No dts in packet
non-existing PPS 4 referenced
log2_max_frame_num_minus4 out of range (0-12): 73
sps_id 8 out of range

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…)

what you are describing sounds similar to my issue that I described here:

if you turn off preload stream on the camera and wait 10 minutes does the video start for you?

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.

1 Like

never worked after disabling preload and waiting 10+ minutes. HA just hung up and needed a restart.

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.

Wanscam (at least HW0043 & HW0022) found on eBay works for me.

(Probably a clone of Instar cameras? )
Stated to be ONVIF compliant, but I gave up on that in HA. (Works in other ONVIF apps though)

camera:
  - platform: generic
    name: Cam1
    stream_source: rtsp://<user>:<pass>@<ip>:554/11
    still_image_url: http://<user>:<pass>@<ip>/tmpfs/auto.jpg
    verfy_ssl: false

switch:
  - platform: command_line
    switches:
      cam1_motion_detect:
        command_on: curl "http://<user>:<pass>@<ip>:80/cgi-bin/hi3510/param-cgi?cmd=setmdattr&-enable=1&-name=1"
        command_on: curl "http://<user>:<pass>@<ip>:80/cgi-bin/hi3510/param-cgi?cmd=setmdattr&-enable=0&-name=1"
        command_state: 'curl -k --silent "http://<user>:<pass>@<ip>:80/cgi-bin/hi3510/param-cgi?cmd=getmdattr" | grep "m1_enable" | cut -c 16'
        value_template: '{{ value == "1" }}'

Pretty cool to stream live-ish to CC and AppleTV now as well.

Martin/

Thanks, that is very useful info and was not apparent.

@hunterjm my dafang camera works on my chromecast. However I only get the picture and a white circle spinning at the bottom left.

Its stuck and not even lagging.

Can you please help?

Thanks.

1 Like

this happens to me constantly

I have no sound coming from Blue Iris. Anyone else lacking sound or know how to fix it?

Sound is not supported yet.

2 Likes

Did you hacked the xiaomi dafang camera to make it working with HA? If not, can you share your config?

I’m seeing the same thing. If I click on any of the videos, it starts to spin and then HA becomes unresponsive “Unable to connect to Home Assistant.”

I’m running HA in Docker on a Synology NAS with amcrest cameras. I assume the container doesn’t have enough resources to handle the load requirement.

What are the minimum specs required for this to work as expected?

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.

Depends on the browser you are using like older fire tablets or older iOS.

So does that mean I would not want to use this setting if I was using an older fire tablet?