Go2rtc project - help thread

Tring to setup rtmp from frigate(running on container and also go2rtc on same machine).
port 1935 is open in container .
the machine address is 192.168.1.113

frigate:

cameras:
  salon2:
    mqtt:
      timestamp: False
      bounding_box: False
      crop: True
    ffmpeg:
      global_args: -hide_banner -loglevel warning
      inputs:
          - path:  rtsp://aaa:[email protected]:554/cam/realmonitor?channel=1&subtype=0
           roles:
            - detect 
            - rtmp  

go2rtc config:

streams:
  salon2_go2rtc: rtmp://192.168.1.113/live/salon2
#also tried with port
#  salon2_go2rtc: rtmp://192.168.1.113:1935/live/salon2

itā€™s not working - geting:

13:06:31.383 TRC [api] GET url=/api/ws?src=salon2_go2rtc
13:06:31.392 DBG [webrtc] new consumer url=salon2_go2rtc
13:06:32.094 WRN [api.webrtc] add consumer error="couldn't find the matching tracks"

would it make more sense to let frigate use the rtmp stream instead(not sure if itā€™s possible)?

So I am getting an error in the add-on log that I canā€™t seem to figure out. The WebRTC component worked fine with my cameras, but I wanted to try go2rtc instead.

ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:51 > error="x509: certificate is valid for 127.0.0.1, fe80::1, not 10.10.1.10"

*10.10.1.10 is my Unifi NVR where the RTSP streams are generated.

Hello, what to do if I donā€™t want to view all my cameras using webrtc? I also want to view regular rtsp streams. Now Rtsptowebrtc is converting all my cameras to webrtc.

@jussbba If you donā€™t want to convert all your streams, you should simply be able to NOT use RTSPtoWebRTC. Instead create a config for go2rtc for whatever streams you want webrtc for and then create generic cameras in home assistant pointing to those go2rtc rtsp urls. Then you can have both.

@calisro Thanks. I added the rtsp url to go2rtc.yaml. I can see the stream link in the go2rtc web gui but how can I add the webrtc stream to home assistant as generic camera?

Got a question about the ?video addition to a RTSP stream. If I interpreter correctly it searches for the first stream without audio, but if it doesnā€™t find a stream without audio, will it just push the stream with audio?

This is at least what Iā€™m seeing, it doesnā€™t extract the audio, or am I doing something wrong?

It will literally just grab the video from any video or audio or video/audio stream.

You create a generic camera pointing to the rtsp stream from go 2rtc. Take a look at the docs for the rtsp url.

Hello,

From docs:

From go2rtc to Hass

Add any supported stream source as Generic Camera and view stream with built-in Stream integration. Technology HLS, supported codecs: H264, poor latency.

  1. Add your stream to go2rtc config
  2. Hass > Settings > Integrations > Add Integration > Generic Camera > rtsp://127.0.0.1:8554/camera1

If I understand correctly, stream is using HLS technology and there is poor latency. How to enable webrtc technology?

It will be webrtc in a picture glance or frigate card. I prefer the frigate card even if youā€™re not using the frigate backend. Add the rtsptowebrtc integration.

So just to be clear, I have a RTSP camera:

voordeur_camera: rtsp://user:[email protected]:8554/3ce1a1b06608_live

Iā€™ve added the ?video, this should ensure the stream is only with video, so no audio. Which looks like this:

voordeur_camera_noaudio: rtsp://user:[email protected]:8554/3ce1a1b06608_live?video

For my Camera this doesnā€™t work.


Based on the remark below I now redirect the noaudio streams to the localhost and this indeed works just fine, thanks!

This is how I have mine setup and it does strip the audio. Note that the filtering applied in the config of go2rtc config.

  garage_main:
    - rtsp://[email protected]:554/videoMain
  garage_noaudio: #Used directly by automation link
    - rtsp://127.0.0.1:8554/garage_main?video

So you can do it like this and have both:

voordeur_camera: rtsp://user:[email protected]:8554/3ce1a1b06608_live
voordeur_camera_noaudio:rtsp://127.0.0.1:8554/voordeur_camera?video

or simply:

voordeur_camera: rtsp://user:[email protected]:8554/3ce1a1b06608_live?video
2 Likes

Hey Rob, thanks for this. Iā€™m actually more leery of changing AD410 settings via ASP than direct API calls due to ASPā€™s propensity for changing additional settings unexpectedly. I did confirm that using ASP to change the Audio compression from AAC to G.711U worked just fine. However, it did ADD some additional VIDEO settings, but I havenā€™t determined yet if it affected quality.

Amcrestā€™s API guide does actually list all the potential audio modes. But to determine what each device actually is capable of run: <ip_addr>/cgi-bin/encode.cgi?action=getConfigCaps This will show ALL the device capabilities, including this result for the AD410:
caps[0].MainFormat[0].Audio.CompressionTypes=PCM, G.711A, G.711Mu, AAC

(G.711U when selected in ASP, saves the value as G.711Mu in the firmware)

1 Like

Help needed, I think I have everything working more or less. If I use the web browser just fine to stream everything :slight_smile: I even got the webRTC stream as an popup on my Google Tv when someone press the doorbell.

  • Itā€™s just one issue I have and if I use HA Companion App on my iPhone and not connected to my local network I cannot see the stream.
  • If Iā€™m connected to my local network I can see the stream via HA Companion App on my iPhone, low latency.
  • Not connected to local network and goes into the go2rtc web interface, select a camera then press stream I can see the stream fine.

I have tried different network settings expended in the readme help GitHub - AlexxIT/go2rtc: Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, MJPEG, HomeKit, FFmpeg, etc.

Nothing helps, so any pointers what Iā€™m doing wrong would be great!

Home Assistant 2022.12.3
Supervisor 2022.11.2
Operating System 9.4
Frontend 20221208.0 - latest

Add-ons
Cloudflare 4.0.5
go2rtc 0.1-rc.5
RTSPtoWeb - WebRTC 1.4.0
NGINX Home Assistant SSL proxy 3.2.0

i followed the doc, 4 cameras added and i can see them
image

added the integration rtsptoweb

image

but no entities showed up, this is the error o think

any tips? i want to add them on my lovelace,

The URL of your Go2RTC page points to 192.168.1.138, your RTSPtoWebRTC integration to 127.0.0.1, does this mean your Go2RTC runs as an addon?

And by ā€˜I can see themā€™ do you mean if you click ā€˜streamā€™ you get presented the camera, or do you mean you can see them in this overview?

And what do you mean by no entries showed up? Did you add the cameraā€™s as generic cameraā€™s? Because the /live/front_door I donā€™t get if your cameraā€™s are called tetto / palestra / vtodahuaā€¦

Did you create a portforward in your router? So forwarding port 8555 from your external IP to your internal go2rtc IP?

@mhoogenbosch I use Cloudflare so no need to open any ports, like I said I can see the stream when Iā€™m no connected via LAN if I go into the web interface of go2rtc and webRTCweb so should not be any issues with ports. But I have also tried to open that port just to rule out is itā€™s that issue, no luck.

I am not known with Cloudflare so Iā€™m afraid I cannot help you. It sure sounds like a port conflict somewhere. Just opening the port doesnā€™t cut it; it should be forwarded. But again; I donā€™t know what cloudflare does for you. Good luck finding the solution.

1 Like

It got me thinking and I can see that these ports are supported by cloudflare (not 8555) Network ports Ā· Cloudflare Fundamentals docs

But then itā€™s strange that I can see the stream in the web interface of both go2rtc and webRTCweb. Not sure if one can change the port of go2rtc? But I feel like I cannot be the only one with this issue, multiple people use cloudflareā€¦