Delay with camera stream

pergola.fabioFabio

Jan 9

I stopped using stream, I use the play command now , works much better

wanted to know how he did it above.

hi, see below
i created a template switch to expose my caremas to google
so i just say: camera xx on/off to google
the link is coming from motioneye streaming url, or you can use what ever stream you want

   google_camera_buiten:
     friendly_name: Camera Buiten
     value_template: "false"   
     turn_on:
       - service: media_player.play_media
         data_template:
           entity_id: media_player.google_hub
           media_content_id: http://192.168.0.23:8082
           media_content_type: "image/jpg"       
     turn_off:
       - service: media_player.turn_off
         entity_id: media_player.google_hub
3 Likes

ok, i see in RC release notes for 110 release , that we can now configure 2 base urls
internal + external

maybe that helps for the slow camera streams!

how does that help? i have also this problem with RTSP streams, 10 seconds behind. and this is in passthrough mode, so the cameras are h264, so there is no transcoding happening via ffmpeg? I think that it got worse on 110. on 104 was working better.

1 Like

In my case it didn’t help…

Try this, let me know if it works.
https://community.home-assistant.io/t/2-minute-stream-delay/185762/6?u=joaquin68

I’m running HA in a docker container on Unraid. I spun up a MotionEye container and fed it the RTSP stream of my Unifi Protect and Wyze cameras. No more delays and perfect response on notifications. Let me know if you need help.

See : motionEye snapshot url does not work

and see: https://www.home-assistant.io/integrations/mjpeg/

2 Likes

Hi, I’m also having a delay. Mine is about 5 seconds so not too bad, but would like to reduce this.

I’ve connected a Reolink E1 Pro through ONVIF integration. Home Assistant is running on Hass.io on a RP 3B.

Does anyone have any advice on what I can do to reduce? I’ve already reduced frame rate and resolution to about 15fps and 1080P and don’t want to go much lower than that. I also have preload stream enabled on the UI.

On ONVIF Device Manager there is no delay at all. Could it be the RP hardware causing the delay?

Testing a Reolink 520 and I have a big 15+ second delay via Home Assistant even with the low res 640x480 _sub feed. I also have the Preload option turned on. In VLC on my macbook there is barely a delay, 1-2 seconds.

Currently running on a Raspberry Pi 3B.

Delay is no better on a Pi 4 and it seems this is related to how HA handles stream feeds. ONVIF integration reduces the delay for me by about 1/2 but still not great (6-10 seconds depending).

I run HASS on a bare metal host and I was getting a 10-20s delays from my HIkvision cameras using Generic platform rstp feed while on VLC I was getting no delays at all. What helped me was to move to mjpeg platfrom (my camera supports it). Now I have real live stream in frontend. Hope this will help somebody

Cheers

camera:
  - platform: mjpeg
    name: cam1
    mjpeg_url: http://<IP>/ISAPI/Streaming/channels/102/httpPreview
    username: !secret cam_user
    password: !secret cam_pass
    authentication: basic
1 Like

This looks interesting RTSP to WebRTC:

I have the same issue, delay getting bigger if stream running on frontend for long time, I’m experiensing 1-15 minute delay, seems like system is recording and then streaming video which causes that delay. Using different hardware does not help as I have ran HA in docker on x86 (Xeon with 16gb ram and 8 cores) PC - same result, so I would say that this is something to do with HA not actual hardware.
Code:

 - platform: mjpeg 
    name: garden_ptz01_camera
    still_image_url: "http://192.168.1.165:8123/api/hassio_ingress/uoZvf79bef14MQMk76FzVuYV1vNSoCYUlxOLNL49x_E/picture/11/current/?_username=admin&_signature=cc38ebd2011565a06dab34228ef38fe4518620d4"
    mjpeg_url: "http://192.168.1.165:8091"

This is the best solution! The lag is gone! Home assistant > Motioneye > rtsp > live stream
To start: motionEye - Home Assistant

1 Like

i’m now doing this on HA Blue (Odroid N2+) with motioneye addon.

yep, thats works great!

For anyone who’s interested, I did a write-up of how I managed to display a low-latency feed an IP camera in a picture-in-picture popup on Android TV using WebRTC Camera. I included some detail on WebRTC and getting the camera stream delay as low as possible, plus router configuration and reasoning behind how you want to expose your HA instance to the internet for all this to work.

Hello!
I have also this issue with delay about 10-15 seconds.
I noticed that delay appear after activating MariaDB. When MariaDB is disabled and HA restarted — delay reducing to 1-2 seconds.

1 Like

One more specificity noticed: video stream delay (15sec) with enabled MariaDB is only on mobile app. PC over browser works fine (2-3 seconds delay) with/without MariaDB.
CPU usage ~6%, RAM usage ~12,5%

Same here, when I disable Maria DB all is fine. Does anyone have an idea what could be the cause?

Edit: Sorry the problem has now occurred again anyway. It also occurs only with the laptop, on the phone it works.