# Gladys Assistant 4.23 : Live camera streaming & Calculations in scenes

**URL:** <https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161>\
**Category:** Actualités\
**Created:** [May 13, 2023, 8:40am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161 "2023-05-13T08:40:40Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [May 16, 2023, 9:43am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/41 "2023-05-16T09:43:39Z")

</div>

I tried on my end and it works whether or not the port is specified.

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [May 16, 2023, 6:00pm UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/42 "2023-05-16T18:00:01Z")

</div>

> [@pierre-gilles](#):
>
> I think the issue came from installations that had a dongle requiring a modification of the configuration.yaml; it would restart in an ‹&nbsp;initial&nbsp;› state with nothing, it’s a regression.
> 
> cc @AlexTrovato
> 
> However, now that the damage is done, unfortunately I don’t know if we can change much, it’s a mistake!

Hmm, indeed, I hadn’t anticipated the case where the configuration had already been manually overridden. My bad.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 18, 2023, 6:53am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/43 "2023-05-18T06:53:56Z")

</div>

Hi everyone!

It’s a public holiday in France, the perfect time to do some home automation around the house 😎

So, who managed to use the live camera streaming feature over the past week?

I’m keen to get feedback on your actual use of this feature to know if the different choices I’ve made make sense and if you find this feature useful!

@guim31 @Mastho @lmilcent @spenceur what’s it like in real-world use after a week? 🙂

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [May 18, 2023, 11:50am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/44 "2023-05-18T11:50:55Z")

</div>

I’ve been able to use it several times; for me it’s perfect.  
If I had to point out one downside, though I think it’s unsolvable: I’d like to click and get the «&nbsp;real&nbsp;» live, not one with a 15-second delay.

It’s just that I often use Gladys to open my gate when I arrive by car and to be able to check that it opens properly.  
Usually either I do it well in advance and it’s fine, or I get the image of the gate opening when I’m already parked 😅

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 18, 2023, 12:01pm UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/45 "2023-05-18T12:01:33Z")

</div>

Thanks for the feedback! When you say «&nbsp;delay&nbsp;», do you mean the time it takes for the livestream to start, or the difference between real time and what you see in the livestream?

15 seconds seems excessive to me — we can definitely optimize that 😉

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [May 18, 2023, 10:28pm UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/46 "2023-05-18T22:28:10Z")

</div>

I’m talking about the lag between reality and the image. Also, it’s simple: my dashboard has the time block and, below that, the stream where I have the timestamp, so I can see the delay live 😊

 ![Screenshot_2023-05-18-18-28-47-762_com.android.chrome](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/7/7ac47609a2b0803794bf57be52734cc53c7064ba.jpeg)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 19, 2023, 4:50am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/47 "2023-05-19T04:50:04Z")

</div>

@guim31 Actually live streaming is a balancing act between setting an «&nbsp;extreme&nbsp;» configuration almost in sync with the live feed, or setting a «&nbsp;safe&nbsp;» configuration but being less live.

For example, if I set a configuration like «&nbsp;I want to have 2 seconds of delay&nbsp;», there’s a risk of frequent stalls at the slightest hitch anywhere in the chain (whether CPU or network)

By stall I mean this:

 ![Screenshot 2023-05-19 at 11.43.39](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/f/f0d4455330feb0cf1fa0008ce7973b18a1de3282.jpeg)

That is, having reached the end of the data present in the player and the next segment is not there yet.

For now, I put a rather safe configuration on the player side, I wasn’t very extreme.

I saw that the video player library I’m using for this development was recently updated with new options for the «&nbsp;low-latency streaming&nbsp;» part, I’ve been playing with it since this morning, and I think I’ll propose a modified Gladys Plus URL for you to test different configurations!

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 19, 2023, 5:48am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/48 "2023-05-19T05:48:38Z")

</div>

@guim31 (and everyone else too!), I’d like your feedback on this Gladys Plus URL:

[https://hls-low-latency.gladys-plus.pages.dev/](https://hls-low-latency.gladys-plus.pages.dev/)

Concretely, what this PR does:

- The video starts playing after 2 segments (instead of 3 segments currently)
- If the live is more than 3 segments behind, the live playback speed will increase up to x1.5 to «&nbsp;catch up&nbsp;».

Also, one thing I’m interested in if you test from a computer on Gladys Plus is the latency you have with the Gladys Plus server for the video files.

You can do this by opening the inspector, «&nbsp;Network&nbsp;» tab, «&nbsp;Fetch/XHR&nbsp;», then start the streaming:

 ![Screenshot 2023-05-19 at 12.45.30](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/b/bb5e5c073e81374dad751fed82e00f9d52266025.png)

I need to see the size and response time of the index.m3u8/indexXX.ts files

(From Asia, I have quite a bit of latency since the server is in Europe, but for you it should be less!)

Edit: Also, don’t hesitate to test the different «&nbsp;latency&nbsp;» settings 🙂 I’m keen to get your feedback on the difference between «&nbsp;Very Low&nbsp;» and «&nbsp;Low&nbsp;», for example!

 ![Screenshot 2023-05-19 at 12.58.30](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/b/b44019495f1f813ff9f372e5fe7f2d62d5bbc3d8.png)

The PR is here: [Configure HLS streaming for low-latency by Pierre-Gilles · Pull Request #1794 · GladysAssistant/Gladys · GitHub](https://github.com/GladysAssistant/Gladys/pull/1794)

---

<div class="post-metadata">

**Author:** ![PhilippeMA](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/p/b3f665/32.png) [@PhilippeMA](https://community.gladysassistant.com/u/PhilippeMA)\
**Post date:** [May 19, 2023, 7:33am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/49 "2023-05-19T07:33:39Z")

</div>

Hello,

On my side, it results in a delay on the order of 7 seconds (camera timestamp vs Gladys clock). That’s very good.

For the stats, here is for a low latency:

 ![Screenshot from 2023-05-19 09-31-35](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/2/228f91d6f05168b1d1c4c182a2f87d3c8299d86c.png)

And for very low latency:

 ![Screenshot from 2023-05-19 09-32-05](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/5/53f95722d296427ddc9d2d277ee9ac5707add996.png)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 19, 2023, 7:38am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/50 "2023-05-19T07:38:01Z")

</div>

> [@PhilippeMA](#):
>
> On my side, it gives an offset of around 7 seconds (camera timestamp vs Gladys clock). That’s very good.

Oh, so it works for you in the end? 😃 Cool! I had been stuck on the moment when it wasn’t working!

7 seconds isn’t bad yes 🙂 I’m sure we can still shave off a little!

I have more good news, I spent a good while tweaking the settings and I realized that other things can be optimized on the ffmpeg side locally

I’ll continue my tests and I’ll push my improvements in this PR

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 19, 2023, 9:27am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/51 "2023-05-19T09:27:53Z")

</div>

I made a Docker image that adds local server-side improvements:

```auto
gladysassistant/gladys:hls-low-latency

```

If anyone wants to test 😉

The optimal ffmpeg configuration I came across is this:

 ![Screenshot 2023-05-19 at 15.41.02](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/6/6608db5c4ab598c909bcbffa35e284afb3ac755f.png)

On the Gladys Plus side, I also found ways to improve latency that I’ll probably publish online sometime next week 🙂

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [May 19, 2023, 10:57am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/52 "2023-05-19T10:57:50Z")

</div>

I’d really like to try all that, but I’m in New York right now! 😂

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 20, 2023, 2:19am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/53 "2023-05-20T02:19:11Z")

</div>

Oh yeah 😂 actually I prefer the numbers at your place!

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [May 20, 2023, 8:53am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/54 "2023-05-20T08:53:20Z")

</div>

I just tested. I have half the latency when starting the live and while live. So about 9sec on average for the live instead of about twenty.

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [May 20, 2023, 4:55pm UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/55 "2023-05-20T16:55:16Z")

</div>

I just ran a 10-second test to start the live stream, and there was between 9 and 10 seconds of delay.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 27, 2023, 3:13am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/56 "2023-05-27T03:13:29Z")

</div>

12 messages have been split into a new topic: [How to retrieve the RTSP stream from a Reolink camera?](https://community.gladysassistant.com/t/comment-recuperer-le-flux-rtsp-dune-camera-reolink/8184)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 22, 2023, 4:10am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/58 "2023-05-22T04:10:41Z")

</div>

> [@lmilcent](#):
>
> I just tested. I have half the latency at the start of the live and during the live.

Great 🙂

I’ve done quite a few tests on my side, and it’s noticeably better. I published Gladys Assistant v4.23.4 which includes these changes to improve camera live streaming latency.

> **[Release v4.23.4 · GladysAssistant/Gladys](https://github.com/GladysAssistant/Gladys/releases/tag/v4.23.4)**
>
> What's Changed
> 
> Fix request entity too large bug on save of camera by @Pierre-Gilles in #1793
> Configure HLS streaming for low-latency by @Pierre-Gilles in #1794
> 
> Full Changelog: v4.23.3...v4.23.4

I also published server-side improvements for Gladys Plus that should improve this.

Once your instance is up to date, I’d appreciate screenshots of the «&nbsp;Network&nbsp;» tab on Gladys Plus during a live stream:

 ![Screenshot 2023-05-22 at 11.07.03](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/d/df537303a2cf9b276c98f7686071fd9c8a57b503.png)

> [@Tlse-vins](#):
>
> I just tested: 10 seconds to start the live and between 9 and 10 seconds of delay.

10 seconds to start the live seems excessive! Could you try again with Gladys Assistant v4.23.4, with latency set to «&nbsp;Low&nbsp;» and «&nbsp;Very low&nbsp;»? Are you on fiber at home? Is your camera picking up the network properly?

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [May 22, 2023, 5:14am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/59 "2023-05-22T05:14:28Z")

</div>

I was in low latency.  
I do have fiber, but I can’t tell if it picks up the Wi‑Fi well. I have a brick wall with a window between the nox and the camera.  
In very low latency I have 7-8 seconds to display the live stream and a 6-7 second delay.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 22, 2023, 5:16am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/60 "2023-05-22T05:16:04Z")

</div>

> [@Tlse-vins](#):
>
> With very low latency I have 7-8 seconds to display the live stream and 6-7 seconds of delay.

Ok, on Gladys Assistant v4.23.4? (I published the update 1 hour ago, so if you haven’t done anything manually it’s unlikely that you’re on that version)

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [May 22, 2023, 5:49am UTC](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161/61 "2023-05-22T05:49:30Z")

</div>

No, I’m still on 4.23.3.

[Previous page](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161.md?page=2)

[Next page](https://community.gladysassistant.com/t/gladys-assistant-4-23-live-streaming-de-cameras-calculs-dans-les-scenes/8161.md?page=4)
