Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live stream loading icon permanently visible #1806

Open
briodan opened this issue Jan 2, 2025 · 17 comments
Open

Live stream loading icon permanently visible #1806

briodan opened this issue Jan 2, 2025 · 17 comments

Comments

@briodan
Copy link

briodan commented Jan 2, 2025

@dermotduffy opening a new issue as per your comment to someone else in issue #1732.

Seeing the save always on blue circle. but the live video loads instantly.

currently on HA 2024.12.5
Frigate card 6.1.2
seeing this with Frigate 14.0 and 14.1

more details on my setup.

  • frigate 14.1 runs in docker
  • frigate 14.0 runs in an LXC (for testing)
  • running a standalone go2rtc server 1.9.7, both frigate instances connect to the same go2rtc server

configuration of frigate card:

type: custom:frigate-card
cameras:
  - camera_entity: camera.camera_front
    live_provider: webrtc-card
    frigate:
      url: http://10.10.10.14:5000
    go2rtc:
      modes:
        - webrtc
@dermotduffy
Copy link
Owner

Seeing the save always on blue circle. but the live video loads instantly.

(Guessing "save" should be "same").

These statements are at odds, I would guess if you are seeing the blue loading circle you're getting image snapshots refreshed once per second, and not a live video stream.

Set this on your config:

live:
  show_image_during_load: false

... and it won't mask your problem with the snapshots. You'd probably just see a blank video element that is failing to load for some reason. We need to find out why!

You are using the webrtc-card live provider, but with go2rtc options. This doesn't really make sense, you might just try go2rtc or ha as your live provider, unless you specifically want the webrtc-card for some reason, and see if that works?

If not, please check if there's anything interesting showing in your Javascript console (F12 in Chrome).

@briodan
Copy link
Author

briodan commented Jan 3, 2025

you are correct i was seeing a refreshed image once per second and it stopped working when i added show_image_during_load: false.

The webrtc-card as a provider used to work, cant remember why i put it there a long time ago.

However i switched to go2rtc as the provider with the config below:

type: custom:frigate-card
cameras:
  - camera_entity: camera.camera_front
    live_provider: go2rtc
    go2rtc:
      modes:
        - webrtc
      stream: camera_front
      url: http://ipaddress:1984

Got rid of the blue loading circle but I'm seeing that sometimes the stream does not load, need to do a refresh and then it comes back.
image

@dermotduffy
Copy link
Owner

Same issue, your stream is not loading, so no particularly new advice. You need to figure out why.

If not, please check if there's anything interesting showing in your Javascript console (F12 in Chrome).

Anything here?

Did you try the ha live provider?

@briodan
Copy link
Author

briodan commented Jan 3, 2025

console shows a bunch of stuff but not sure which are relevant, here is a few screens of things that look video related. all these warnings and errors disappear after a reload.

lots of there warnings
image
some of these wranings
image
a couple of these errors
image

@briodan
Copy link
Author

briodan commented Jan 3, 2025

adding a note that this always occurs after editing the card, now that i think of it i dont think i have seen the failure to load on a fresh load of the dashboard.

@Kugelfang666
Copy link

same issue for me when in fact I can see that the stream I loaded because the timestamp in the video feed is changing but the icon is still persistent

@briodan
Copy link
Author

briodan commented Jan 4, 2025

same issue for me when in fact I can see that the stream I loaded because the timestamp in the video feed is changing but the icon is still persistent

Did you try setting the load option below to test?
live: show_image_during_load: false

one things learned (probably for the second time) is that it will load a static image while waiting for the live stream once every second, which will appear as a live stream when looking at a camera with no active motion and just a date stamp.

@Kugelfang666
Copy link

same issue for me when in fact I can see that the stream I loaded because the timestamp in the video feed is changing but the icon is still persistent

Did you try setting the load option below to test? live: show_image_during_load: false

one things learned (probably for the second time) is that it will load a static image while waiting for the live stream once every second, which will appear as a live stream when looking at a camera with no active motion and just a date stamp.

oh WOW you were right, I was just about to try disabling the images when a car passed by and I realized im receiving one frame/s

seems in fact the stream is not up and I'm looking a series of pictures!

@briodan
Copy link
Author

briodan commented Jan 4, 2025

Same issue, your stream is not loading, so no particularly new advice. You need to figure out why.

If not, please check if there's anything interesting showing in your Javascript console (F12 in Chrome).

Anything here?

Did you try the ha live provider?

so I think the stopped stream after i made the change above was an artifact of editing the cards and I don't see it when just loading the dashboard only after editing, so thats probably a red herring.

While the config above solved the live stream loading issue on the local network, the stream is not loading when remote (on mobile device) and accessing HA through nabu casa.

I know in 2024.11 they brought in native go2rtc and a webrtc proxy through nabu casa but i'm not able to find any config guides on what I should change/setup for that to work.

using the following config loads the stream as MJPEG (i thing because it flashed MJPEG on the screen before it disappears) it does this both on the LAN and remote

type: custom:frigate-card
cameras:
  - camera_entity: camera.camera_front
    live_provider: ha
live:
  show_image_during_load: false

HA has webrtc Camera installed pointing to the go2rtc server

@Kugelfang666
Copy link

For me after a full restart of HA everything started to work again. No idea what exactly was the issue before

@briodan
Copy link
Author

briodan commented Jan 4, 2025

So interestingly enough after a host reboot (not an HA restart) on the local LAN the config below now loads in webrtc instead of mjpeg, however on mobile outside the network it loads a picture of the camera with a play icon, when clicking the play icon nothing happens.

type: custom:frigate-card
cameras:
  - camera_entity: camera.camera_front
    live_provider: ha
live:
  show_image_during_load: false

the go2rtc config above still does not load.

@briodan
Copy link
Author

briodan commented Jan 4, 2025

took another approach to this and added one of the go2rtc rtsp streams as a generic camera in HA, and used the following frigate card config

type: custom:frigate-card
cameras:
  - camera_entity: camera.test
    live_provider: ha
live:
  show_image_during_load: false
status_bar:
  style: outside
  position: top
  popup_seconds: 30

huzza the stream loaded right away both internally and externally with almost no lag.

additional thing i tried was to add one of the camera stream into the frigate provided go2rtc to eliminate one step from the chain, it did not make a difference into the frigate cameras loading externally.

I also tried the above with using the frigate provided go2rtc rtsp link for a generic camera and it continued to work correctly.

now the question becomes what in my setup is causing it not to work externally with a frigate provided camera? or is that intended behaviour?

@dermotduffy
Copy link
Owner

now the question becomes what in my setup is causing it not to work externally with a frigate provided camera? or is that intended behaviour?

Not intended. Frigate cameras should (and/do for me) work just fine out of the box, so something is causing your stream not to load from Frigate.

adding a note that this always occurs after editing the card, now that i think of it i dont think i have seen the failure to load on a fresh load of the dashboard.

Ah, so if you don't edit the card, it does work reliably -- only after you "return" from editing there's a problem?

@briodan
Copy link
Author

briodan commented Jan 8, 2025

Ah, so if you don't edit the card, it does work reliably -- only after you "return" from editing there's a problem?

yes it seems to be consistently only after returning from editing, so maybe its an issue but most likely not related to the others.

Not intended. Frigate cameras should (and/do for me) work just fine out of the box, so something is causing your stream not to load from Frigate.

So I did a bit more testing:

  • I took the rtps stream link generated by both my go2rtc server and the frigate built in go2rtc server and I added both those links as generic cameras
  • setup both cameras in frigate cards with HA as the live provider and both streams loaded in the mobile app externally
  • at the same time the frigate camera entity with the same frigate card configuration did not load
  • I also noticed that when doing a hard refresh on the the dashboard on the LAN, the streams for the generic camera entities load instantly while the stream for the frigate camera entity takes 3-5 seconds to load.
  • i enabled the debug UI in the HA built in go2rtc server and I see it provide streams for the generic camera entities, but not for the frigate camera entity.

So I checked my frigate integration config and I had "Use Frigate-native WebRTC support" enabled, so I turned it off, and frigate camera stream loaded just fine in the mobile app externally, and on the LAN there was no lag for the stream to load compared to the generic camera entity.

@briodan
Copy link
Author

briodan commented Jan 8, 2025

So just when I though I figured it out, its not

With the success in the previous post I went ahead and converted my other cameras frigate cards to use ha as the live provider and those cameras only load in mjpeg. WTF?

Card config

type: custom:frigate-card
cameras:
  - live_provider: ha
    camera_entity: camera.camera_garage_old
live:
  show_image_during_load: false
status_bar:
  popup_seconds: 30
  position: bottom
  style: outside

results:
image
image
image

Garage_old camera is the only one that generates as stream in the built in Go2RTC server

@dermotduffy
Copy link
Owner

With the success in the previous post I went ahead and converted my other cameras frigate cards to use ha as the live provider and those cameras only load in mjpeg. WTF?

Home Assistant is rendering MJPEG for some reason, likely not related to the card.

I'm going to guess if you just open the camera in your HA dashboard (separate from the card) you'll have the same issue. You can just press 'e' on your dashboard, select your camera entity and see what you're getting. If you're not sure from the picture, you can open your browser's developer tools (usually F12) and select the video stream. If it's img, you're getting MJPEG feed for some reason.

Why HA is recommending that, I cannot tell you.

@briodan
Copy link
Author

briodan commented Jan 21, 2025

so after looking at it again looks like for all frigate cameras it does not use the built in go2rtc server and its trying to use the frigate built-in go2rtc server, which is strange because i have the option in the frigate integration set to to not use frigate-native webrtc support.

Image

To make matters even more confusing if I look at the go2rtc network map for the frigate built in go2rtc it show that its providing webrtc to my desktop (the 192. address) and rtsp to HomeAssistant (the 10. address) as well as to itself.

Image

Why is it providing webrtc to my desktop and I get MJPEG?

If I turn on frigate-native webrtc support. in the frigate integration the streams now load as webrtc and the network map change to provide both a webrtc/json stream and a webrtc one.

Image

so i think the issue is that even if i deselect the "frigate-native webrtc support" its still getting used instead of native HA go2rtc but its missing something which is why it results in an MJPEG stream instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants