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

Improve support for HA 2024.11.0 WebRTC streaming #759

Closed
felipecrs opened this issue Nov 6, 2024 · 14 comments · Fixed by #784
Closed

Improve support for HA 2024.11.0 WebRTC streaming #759

felipecrs opened this issue Nov 6, 2024 · 14 comments · Fixed by #784

Comments

@felipecrs
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Home Assistant now ships with WebRTC support out of the box:

https://www.home-assistant.io/blog/2024/11/06/release-202411/#low-latency-cameras-using-webrtc

Fun fact: they also use go2rtc:

https://www.home-assistant.io/integrations/go2rtc

But that doesn't matter. The problem is: streaming Frigate cameras over WebRTC doesn't work. I found this in my browser console logs:

{
    "code": "webrtc_get_client_config_failed",
    "message": "Camera does not support WebRTC, frontend_stream_type=hls"
}

And the stream never loads. I believe this is a bug in Home Assistant, because they mention in their release notes that it would fallback to HLS player if WebRTC doesn't work.

This is why I'm logging this as a feature request here. :)

Describe the solution you'd like
To allow to stream cameras from Frigate integration using HA's native WebRTC.

Describe alternatives you've considered
N/A

Additional context
N/A

@NickM-27
Copy link
Collaborator

NickM-27 commented Nov 6, 2024

Webrtc in 2024.11.0 works fine for me when webrtc is enabled in the frigate integration configure menu

@NickM-27 NickM-27 changed the title Add support for HA 2024.11.0 WebRTC streaming Improve support for HA 2024.11.0 WebRTC streaming Nov 6, 2024
@NickM-27
Copy link
Collaborator

NickM-27 commented Nov 6, 2024

We likely will want to enable this by default when go2rtc has webrtc setup in the integration

@felipecrs
Copy link
Contributor Author

felipecrs commented Nov 6, 2024

I can confirm it works again after enabling that option in the integration configuration:

image

Thank you!

@felipecrs
Copy link
Contributor Author

We likely will want to enable this by default when go2rtc has webrtc setup in the integration

Or maybe removing this option entirely, and instead automatically enable it during initialization in case go2rtc integration is loaded (and disable it otherwise).

@NickM-27
Copy link
Collaborator

NickM-27 commented Nov 6, 2024

It sounds like we can support HLS and webrtc at the same time, need to figure out how that is done.

@felipecrs
Copy link
Contributor Author

When I enable WebRTC in the Frigate integration configuration, Home Assistant can still play the stream in my TV (which uses HLS and is 10-15 seconds delayed).

So maybe it's already the case? All it takes is to have WebRTC enabled?

@felipecrs
Copy link
Contributor Author

Or maybe in this case HA is using go2rtc to relay the WebRTC stream to a HLS one. Maybe that's why it's working.

@NickM-27
Copy link
Collaborator

NickM-27 commented Nov 6, 2024

Or maybe in this case HA is using go2rtc to relay the WebRTC stream to a HLS one. Maybe that's why it's working.

oh yeah that would make sense

@IetIesAai
Copy link

Enabled the option, but I still see the described fallback to HLS, and no stream....

@johnpc
Copy link

johnpc commented Nov 10, 2024

Enabled the option, the live stream loads, but the previews and recordings do not play (just the preview thumbnail successfully loads).

When you download a clip, it successfully downloads the clip associated with the thumbnail, so you know that it's correctly referencing the media.

I'm using HAOS on raspberry pi 4.

Is there any workaround?


UPDATE: I have rolled back HA version 2024.10.4 and now its working fine

@kgiedrius
Copy link

please fix this annoying bug

@felipecrs
Copy link
Contributor Author

To be clear, this issue does not refer to a bug, it refers to a new feature to be implemented. You probably meant home-assistant/frontend#22755 instead.

@felipecrs
Copy link
Contributor Author

Or maybe in this case HA is using go2rtc to relay the WebRTC stream to a HLS one. Maybe that's why it's working.

oh yeah that would make sense

I was able to confirm that this is NOT the case. In fact, what seems to be happening is that the HLS player simply calls stream_source function, and handles it in case a value (RTSP link) is returned.

This is good news :). But it's a bit different than what documentation says (see the third bullet here).

@s9550110
Copy link

I can confirm it works again after enabling that option in the integration configuration:

image

Thank you!

A screenshot! - I love a screenshot. It's taken me ages to find out where this tick-box was - Thank you

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

Successfully merging a pull request may close this issue.

6 participants