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

go2rtc is built in Home Assistant 2024.11 #26

Open
AlexxIT opened this issue Nov 13, 2024 · 10 comments
Open

go2rtc is built in Home Assistant 2024.11 #26

AlexxIT opened this issue Nov 13, 2024 · 10 comments
Labels
go2rtc go2rtc - Ultimate streaming application

Comments

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 13, 2024

go2rtc is now built into Home Assistant starting from version 2024.11. This will allow users to view real time stream from their cameras without any additional configuration, using WebRTC technology.

Even though there was no mention of the go2rtc project in the release notes, the interest of GitHub users has increased a lot these days. The project has been on GitHub's top trending page for a few days. In Golang trends, it was ranked number one 5 days in a row.

AlexxIT%2Fgo2rtc | Trendshift

All of this got my account into the top 1000 GitHub users (based on stars count) faster than I expected. Thanks to all the users of all my projects for this.

AlexxIT

Do I need to remove the go2rtc addon or the custom WebRTC integration?

Probably the most frequent question from people who have been using WebRTC in Home Assistant for a long time. The answer depends on the features you are using.

In the most basic version of viewing the stream from cameras - additional addon or custom integration are no longer needed. But when are they needed?

Reducing the number of connections to the camera

If you have a good camera, such as a $100 Dahua, it can usually handle multiple connections without any problems.

But if you have a simple, cheap camera, like a $10 TP-Link, it can handle one, maximum two connections. Some models can handle more. If the Wi-Fi connection is not reliable - the second connection may have packet losses. If you have enabled video recording on the card or motion detection on the camera - the load on the camera also increases.

A good solution is to use the go2rtc addon where you set up one connection to that camera. And in all other software where you need a stream - use this single connection.

go2rtc will open the connection when the first client arrives and close the connection when the last client leaves.

Using advanced sources

go2rtc is not only about RTSP cameras. It supports many formats and some of them exclusively.
For example, HomeKit cameras, Roborok vacuum cleaners, USB cameras, DVRIP protocol, Bubble, Kasa, and others.

Using MSE

The custom card, in addition to WebRTC technology, also is able to use MSE.
This technology supports codecs that WebRTC technology does not yet support. For example, H265 and AAC.
And this technology also does a better job with external connectivity to your Home Assistant, in case there are any problems connecting via WebRTC. Nabu Casa users should not worry about this problem, because the paid subscription includes access to the TURN server. One more reason for supporting the Home Assistant core team.

Using two way audio

The custom card supports two way audio if the camera supports it.

Playing TTS on two way cameras

Yes, the custom card supports this as well.

go2rtc in venv installation

go2rtc is only built in Docker versions of Home Assistant (including Supervised and OS). It's not in the regular python version. In this case, you can use go2rtc built into the custom integration. This works even in the windows - HassWP.

Conclusion

There are other addon or custom card features that you may be interested in. It is better to explore the documentation.

This was just the first release of Home Assistant with go2rtc built in. There will probably be more and more features in new versions. I know there is work in progress to support two way audio out of the box.

Hopefully, with our combined efforts, Home Assistant users will have the best experience viewing real time video from their cameras.

@AlexxIT AlexxIT added the go2rtc go2rtc - Ultimate streaming application label Nov 13, 2024
@felipecrs
Copy link

@AlexxIT, this is amazing. I have been closely following your hard work at go2rtc and I'm really happy about your achievements. All the best for you!

@alexanderdominicnesbitt

@AlexxIT amazing work, thank you! Do you have any guidance on fixing the dashcast setup now it's natively supported? I loved my camera feed auto casting when detects someone

@AlexxIT
Copy link
Owner Author

AlexxIT commented Nov 15, 2024

DashCast (casting any webpage) not supported in HA out of box. You can use it only via custom integration - WebRTC or DashCast.

@alexanderdominicnesbitt

DashCast (casting any webpage) not supported in HA out of box. You can use it only via custom integration - WebRTC or DashCast.

Thanks for the reply. Now the Nabu casa (I have a sub) are running the WebRTC server, I assume I point the WebRTC camera config to their servers instead of to the addon config? Anyideas what the Nabu casa server address is?

image

image

@tommyjlong
Copy link

Newbie using only native HA (no custom cards, addOns, Integrations) regarding the 2024.11 feature "WebRTC".
Have a couple of questions for clarity:

  1. This documentation uses the terms: "RTSPtoWeb{RTC} server" and "RTSPtoWeb{RTC} proxy server".
    a) As for "server", do these two terms mean the same thing?
    b) Is go2rtc the implementation of a RTSPtoWeb{RTC} server/proxy-server? Or are they different things?

  2. There is a statement in this same document on limitations of RTSPtoWeb and RTSPtoWebRTC.
    a) What is the difference between RTSPtoWeb and RTSPtoWebRTC?
    b) How do they apply to Native HA situation (i.e. no customs)?
    My confusion is that the limitations referenced in the document point to differing github repositories (from deepch), yet my thinking is that limitations should apply to the native version of HA's go2rtc which has its own repository (from AlexxIT).

@felipecrs
Copy link

@tommyjlong, nevermind RTSPToWebRTC. They are separate integrations not related to go2rtc (even though go2rtc can act as a RTSPToWebRTC server). They are also not used by HA unless you explicitly enable them. Personally I believe this integration will be deprecated.

You should refer to:

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

@Maes152
Copy link

Maes152 commented Nov 18, 2024

Hi Alexx, thanks for writing this up.
I am a nabu casa subscription user and I've been using your go2rtc addon & "WebRTC Camera" integration for a long time. I also use the custom card. I've never been able to get RTC to work remotely so the custom card switches to MSE when my phone is on 5G. This has been working fine for the most part.

Since you also mentioned that if I keep using my current setup, I can reduce the number of connections to the camera, I think I will keep everything the way it is.

However, my question: Am I somehow able to use Nabu Casa's external RTC turn server while using my current setup? It would be nice to be able to use RTC remotely.

@AlexxIT
Copy link
Owner Author

AlexxIT commented Nov 18, 2024

  1. First you have to make sure that the stream uses the H264 codec. Because H265 will be through MSE anyway.
  2. It's reasonable to use TURN from Nabu Casa if you're paying for it anyway. It will only work with a standard lovelace card.
  3. You can only use one go2rtc from an addon. And configure HA to use it for the standard card.
  4. To guarantee one connection to the camera - you need to configure it in go2rtc, then add it to HA from go2rtc (generic rtsp). Because a standard card will connect both the old and new way to the camera. And this is already two connections at the same time.

@Maes152
Copy link

Maes152 commented Nov 18, 2024

Thanks for the quick response, that was helpful.

I've setup HA in configuration.yaml to use the go2rtc addon, but I don't think it's working. When I create a picture-glance card it is seemingly slower than the custom card. It's also running about 7 seconds behind.
Finally, I don't see an additional stream popup in go2rtc. But to be honest, I have no idea how to confirm that the card is actually using RTC....

This is what I added in the configuration.yaml:
go2rtc:
url: http://localhost:1984

Anyway I think I prefer the custom card over the picture-glance card any day of the week. If only because it displays the connection technology on the top right corner.

Will there ever be a change to the custom card so that it is able to use Nabu Casa's turn server?

@AlexxIT
Copy link
Owner Author

AlexxIT commented Nov 18, 2024

Adding TURN from Nabu Casa to a custom card isn't easy. I don't have time for that yet. And need to ask HA core team for permission to do it.

PS. If the standard card has a white time slider, that's old HLS technology. If the time slider is gray (inactive) - it is WebRTC.

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

No branches or pull requests

5 participants