Sorry, you are right, it was an over simplification. On the other hand, many users out there are focused on faster streaming with their existing rtsp based cameras, or, this is my misinterpretation:-)
@AlexxIT , one thing is not clear to me for existing cameras inside home assistant, can they work without any configuration with go2rtc? What should an end user do to get benefits of go2rtc for a very basic rtsp camera setup?
- Install addon go2rtc
- Install built-in integration RTSPtoWebRTC
Thatâs all. You already get WebRTC when open almost any camera window in frontend.
You can enable âcamera view: liveâ setting and get WebRTC on dashboard without opening camera window.
Also you may need to setup WebRTC TCP port (in go2rtc.yaml), so your cameras will always work externally without problems.
Clear now, i missed the integration part, let me try it out locally and i can inform eufy security users to migrate over this, currently i am advising everyone to stick with webrtc integration
WebRTC Camera custom integration will be updated when go2rtc will be released. I think users will have options in the future:
- only WebRTC Camera custom integration (with go2rtc inside)
- go2rtc addon + RTSPtoWebRTC built-in integration
- go2rtc addon + WebRTC Camera custom integration
RTSPtoWebRTC integration replaces HLS API for many Hass cameras to WebRTC API.
HLS API can be provided with Hass bulit-in stream integration and built-in ffmpeg libraries.
WebRTC API can be provided with some external addon. RTSPtoWeb addon or RTSPtoWebRTC addon or go2rtc addon.
You know, add-ons might be limiting the user base, as it requires either supervisor or self managed docker but custom integrations looks more accessible, in my personal view.
The addon is literally just a running of the go2rtc binary. Anyone who canât install an addon can run the binary and get the same thing at the moment. Itâs really that simple. But yes an integration will help quite a bit. Iâm looking forward to the integration to regain the ability to create webrtc temporary links again.
Is anyone here using the android companion app to view the stream locally? My stream freezes after a few seconds and I canât get it to unfreeze without navigating away on the app. Sometimes itâll freeze, then jump forward a bunch of seconds and freeze again. It works perfectly in my browser.
It only happens with WebRTC. RTMP, RTSP, and JSMpeg play without any issues.
Iâm using 4k amcrest cameras. I donât see any system resource issues.
Works okay in my companion app. Except if I try to view many live streams at once. But thatâs simply a resource issue
How have you configured things? What card are you using? Entries in go2rtc.yaml? etc.
Hereâs my current config:
Camera â RTSP â Frigate â RTMP â Home Assistant. I have RTSPtoWebRTC pointing to go2rtc. My go2rtc.yaml is empty. I see the RTMP stream added automatically in the go2rtc UI when I start a stream.
I see the freezing issue with the Frigate Lovelace Card as well as the Picture Glace card.
Troubleshooting Iâve done:
If I remove go2rtc and RTSPtoWebRTC and add a generic camera with a direct RTSP from the camera it does not freeze.
If I add the RTMP stream from Frigate the stream does no freeze.
I tried using AlexxITâs older WebRTC plugin only and I get the same issue, stream freezes when it flips to WebRTC (I know itâs webrtc because Iâve verified in developer tools and the icon flipped to webrtc in the corner)
The stream freezes in both the iOS and Android companion apps (only webrtc) but not in any browser.
I wonder if itâs related to the stream being 4k resolution. Iâm using Amcrest cameras and H264. I have 1 1080p camera and while it still freezes, itâs not nearly as bad as the 4k ones. The cameras are hardwired, and HA is running in a VM with plenty of CPU and RAM allocated to it).
and to confirm, youâve disabled the old âwebrtc cameraâ? Because they will interfere with each other.
Yup. I currently only have go2rtc and RTSPtoWebRTC installed. Iâve rebooted between reinstall to be safe.
For anyone using ffmpeg transcoding, you may want to adjust your audio bitrates. most people on these forums will use this for cameras. The default audio bitrate for opus, for example, is 128k (ffmpeg default for opus). Thatâs ridiculously high for such an application. May want to set your defaults depending on what youâre using. IF youâre transcoding that isâŚ
ffmpeg:
opus: "-c:a libopus -b:a 16K -vbr constrained"
^ for example
@CrashnBrn is problem same with go2rtc beta.4? I think you need to share your camera stream with me, so I can check it with debugger. You can do it using Ngrok tunnel as example.
@calisro How did you get a webrtc stream from go2rtc in âpipupâ? Is there a âgui-lessâ URL somewhere available in go2rtc/ha?
I believe when this is officially released there will be a âcreate weblinkâ service which l will use again. Till then Im using the âwebrtcâ link in the go2rtc gui to send to pipup.
One thing I learned though⌠Sending audio to pipup stops whatâs running on the android tv. I created a audioless filtered rtsp feed that I use to send there.
http(s)://ha.local:1984/webrtc.html?src=garage_noaudio
You can use go2rtc filter for thatâŚ
garage_main:
- rtsp://xxx:[email protected]:554/videoMain
garage_noaudio:
- rtsp://127.0.0.1:8554/garage_main?video
Two questions:
-
when I use the RTSPtoWebRTC integration, it automatically creates the stream in go2rtc. However, the ânameâ of the stream is the URL or the rstp stream. Like ârtsp://user:[email protected]/axis-media/media.amp?videocodec=h264&streamprofile=HASS&camera=1â instead of the âfriendlyâ name it has in home-assistant. Is it because of the âAxisâ integration instead of the Generic camera? Is there a way to give the camera a friendly name in go2rtc?
-
I tried to remove the RTSPtoWebRTC integration, to avoid the automatic creation of streams in go2rtc. I added the cameraâs manually in the go2rtc.yml (with a friendly nameâŚ) and the webrtc stream from the go2rtc GUI works as expected. But how can I now have this webrtc stream back in Home Assistant without RTSPtoWebRTC? I tried to create a generic camera using the go2rtc rtsp:// but that does not seam to use the latency free webrtc.
That is how I have mine setup. I donât have the RTSPtoWebRTC integration installed at all. I use a iframe to access my cameras like this:
camera_view: auto
type: picture-glance
title: null
entities: '[]
camera_image: camera.garage
aspect_ratio: 432x324
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: 'garage_main Live'
size: wide
content:
type: iframe
url: URLTOAPI/webrtc.html?src=garage_main
aspect_ratio: 75%
I believe that in order to use the picture glance cards and such, youâd need to use an integration that incorporates the javascript code to do the webrtc.
If you want to use the glance card or other inbuilt HASS cards that do not understand webrtc, you need the integration. The iframes work really well for me and allow 2 of my cameras to do 2-way communication. Maybe when a webrtc specific card matures, iâll switch back to it.