Coder Social home page Coder Social logo

Comments (31)

cataseven avatar cataseven commented on May 22, 2024 1

Hi - first off I wanna say, that this is great work. Both go2rtc and WebRTC is really great. However, my wife has a problem with her iPhone and the Home Asisstant companion app: She cannot view the WebRTC cameras outside of our network, and sometimes not on our network either. My Android phone can easily view the cameras. What my wife tends to do, is open the TuYa app we have for one of our Sonoff cameras and use that. It's not great, because only 1 of our cameras is in that app.

Our RTSP cameras are set up like this in Home Assistant (Dahua and Sonoff):

type: custom:webrtc-camera
url: rtsp://cam:[email protected]:554/live

I've now tried go2rtc and I'm guessing it's the same, because of how Home Assistant proxies the network traffic from the cameras.

I want my wife to be able to open an app (or browser) and view all of our cameras nice and easily in one app. I have the following stuff to help:

  • Home Assistant
  • Unraid on a server (meaning I can spawn any VM or Docker container)
  • I'm a web developer, so creating a page with the streams on it is not a problem
  • I have a domain and can easily do proxying to that domain

What would you recommend? Obviously keeping it in Home Assistant would be the best, so we have everything in one place, but I honestly cannot figure out why her phone cannot view the streams, so I'm forced to find an alternative.

Just use picture glance or picture element card after go2rtc integration. (I am using Elements) #38

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024 1

@cataseven Based on what you have posted, you are not using go2rtc. If you remove the addon, your cameras will still work. You have added the cameras to go2rtc, but they are not being used. You should be using the URL from go2rtc on port 8554 and then the name of the camera, like this: rtsp://192.168.1.123:8554/frontyard1

As it is right now, go2rtc does nothing for you.

from go2rtc.

AlexxIT avatar AlexxIT commented on May 22, 2024

WebRTC

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@AlexxIT Yes, I read that. I'm asking what you would do. Setting up Ngrok would be pointless, seeing I already have a domain and the option to easily proxy the traffic to that domain. Is it a pretty solution? Absolutely not. That's what I want. I want an user friendly way of showing the cameras instantly either via an app or a website. Something static that never changes, like the URL to Ngrok does (unless I pay for it).

from go2rtc.

AlexxIT avatar AlexxIT commented on May 22, 2024

WebRTC technology can't use your "domain" HTTP or HTTPS port. It should own personal port for media data. The way how you setup this port depends on your network configuration. For static or dynamic public IP address you do not need to use Ngrok. You need to read docs more carefully.

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@AlexxIT Okay, I don't think you understand what I am asking here.

I want an app where I can open the app and instantly view the cameras I have. Alternatively a web page with each camera embedded. As explained in the post, Home Assistant is not an option because of how it proxies the network (won't work outside of my local network, but ONLY on my wife's phone).

Shinobi is an example of an app that can do most of what go2rtc can do, but they also have an app or alternatively if you port forward their web UI, you can log into your account from the outside and view your cameras that way. go2rtc doesn't have a nice frontend or an app I can open to view my cameras, and that's exactly what I am looking for.

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@cataseven No, as I said before, Home Assistant cannot proxy the feed to my wife's iPhone in the companion app. My iPad had the same issue through the browser as well. Not sure if it's an iOS issue, though.

from go2rtc.

AlexxIT avatar AlexxIT commented on May 22, 2024

Well. What iOS version we talking about?

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@AlexxIT iOS 15.6.1. I also experience some glitching on Windows in Chrome with webrtc, but I also did that with picture glance and the RTSP stream, so I doubt the issue is with anything you have created, but rather how Home Assistant does the proxying. I'm running HA in Docker on a server with a 3900X, 32GB RAM, and NVMe SSD, so I doubt the reason is hardware.

from go2rtc.

cataseven avatar cataseven commented on May 22, 2024

@cataseven No, as I said before, Home Assistant cannot proxy the feed to my wife's iPhone in the companion app. My iPad had the same issue through the browser as well. Not sure if it's an iOS issue, though.

I tried with my wife's iphone right now. It is working. I have an android phone and all settings are same for both iphone and android. No problem with iphone.

Here is my config

  • deleted rtsptoweb add on.
  • deleted webrtc integration
  • deleted motion eye add on
  • deleted all folders remainnin config folder related to above addons
  • installed go2rtc
  • created generic cams with rtsp links. Generic cam settings: tcp or udp, frame rate: 24, auth: basic, verify ssl: false, username: null, password:null, rtsp links of cameras taken from onvif manager
  • picture glance card

No problem for iphone 11.

Btw, ı am not a developer, i have limited technical knowledge, may be ı couldnt understand your problem but I can view 3 cameras on iphone 11 via home assiststant app. Hope this helps

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@cataseven Does it also work while on mobile network? Outside of your own network and own WiFi.

from go2rtc.

AlexxIT avatar AlexxIT commented on May 22, 2024

It may not work outside your network if you don't do anything with your setup!

from go2rtc.

cataseven avatar cataseven commented on May 22, 2024

@cataseven Does it also work while on mobile network? Outside of your own network and own WiFi.

It is working for both phones via mobile data

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@AlexxIT What do you mean? Home Assistant is running on a subdomain and is very public. It works fine on my Android phone, as I've said a few times now.

@cataseven Okay, that's odd. So you use a picture glance card, and you just use go2rtc with the example from your own issue #38 ? Then I'm not sure where the problem is, because I've tried the exact same thing.

from go2rtc.

cataseven avatar cataseven commented on May 22, 2024

I will create a backup and try to understand :) If @AlexxIT says "It should not work" probably I forget something to delete somewhere. I will write to u if I find something

from go2rtc.

cataseven avatar cataseven commented on May 22, 2024

@AlexxIT What do you mean? Home Assistant is running on a subdomain and is very public. It works fine on my Android phone, as I've said a few times now.

@cataseven Okay, that's odd. So you use a picture glance card, and you just use go2rtc with the example from your own issue #38 ? Then I'm not sure where the problem is, because I've tried the exact same thing.

Deleted everthing and tried. No problem via mobile data once again. My cameras connected via etherhet cable directly to my router. I remember that wifi connection creates problem even it has a strong signal connection.

My Camera (Cheap Chinese Cam)
2022-09-12 11_03_14-fjramirez1987_PTZ-YCC365

My Add-on page
2022-09-12 11_05_48-Home Assistant

Add-on Repos
2022-09-12 11_07_01-Home Assistant

My Integrations
2022-09-12 11_07_44-Settings – Home Assistant

Generic Cam Settings: It "sometimes" takes 5-10 seconds to start (Maybe you should use UDP)
2022-09-12 11_11_33-Settings – Home Assistant

I am using ptz-ycc365 add on to control camera movement
https://github.com/fjramirez1987/PTZ-YCC365

I only added go2rtc.yaml
2022-09-12 11_18_03-Studio Code Server – Home Assistant

My card config:

......... bla bla bla

          - type: picture-elements
            camera_view: live
            camera_image: camera.frontyard
            elements:
              - type: icon
                icon: mdi:arrow-left-drop-circle
                tap_action:
                  action: call-service
                  service: ptz_camera.move_left
                  service_data:
                    host: 192.168.1.143
                style:
                  bottom: 45%
                  left: 2%
                  color: white
                  opacity: 1
                  transform: scale(1.25, 1.25)
              - type: icon
                icon: mdi:arrow-right-drop-circle
                tap_action:
                  action: call-service
                  service: ptz_camera.move_right
                  service_data:
                    host: 192.168.1.143
                style:
                  bottom: 45%
                  right: 2%
                  color: white
                  opacity: 1
                  transform: scale(1.25, 1.25)
              - type: icon
                icon: mdi:arrow-up-drop-circle
                tap_action:
                  action: call-service
                  service: ptz_camera.move_up
                  service_data:
                    host: 192.168.1.143
                style:
                  top: 2%
                  left: 46%
                  color: white
                  opacity: 1
                  transform: scale(1.25, 1.25)
              - type: icon
                icon: mdi:arrow-down-drop-circle
                tap_action:
                  action: call-service
                  service: ptz_camera.move_down
                  service_data:
                    host: 192.168.1.143
                style:
                  bottom: 2%
                  left: 46%
                  color: white
                  opacity: 1
                  transform: scale(1.25, 1.25)
              - type: icon
                icon: mdi:fullscreen
                tap_action:
                  action: more-info
                entity: camera.frontyard
                style:
                  top: 1%
                  right: 2%
                  color: white
                  opacity: 0.5
                  transform: scale(1.25, 1.25)

...... bla bla bla

from go2rtc.

cataseven avatar cataseven commented on May 22, 2024

I think solution will be related to rtsp link template.

Can you please remove username and password from rtsp link and try once again? My cams are also on Tuya app but I do not use username or password in my HA rtsp links. I even can turn on Private mode if I do not want to use ptz control. (external ptz controls still needs active cam on Tuya app, not sleeping)

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@cataseven So you don't use go2rtc..??

from go2rtc.

cataseven avatar cataseven commented on May 22, 2024

@cataseven So you don't use go2rtc..??

I think I am using :) I added it as add-on. (please see add on page above) After I added the add on my external access problem has gone! I am confused! no idea how but it works. Before go2rtc I couldnt watch away from home. Even I turn cameras off on tuya app, they work on HA

from go2rtc.

cataseven avatar cataseven commented on May 22, 2024

did you try this? as far as I see, the only difference bwt your and mine is generic camera definitions. I have no pass or username

somthg like rtsp://192.168.1.111:554/live should work for u. ( ı am not an expert or developer ofc but thats what I see as a difference)

did you get this url from Onvif manager software?

from go2rtc.

cataseven avatar cataseven commented on May 22, 2024

Are u sure? I will uninstall it and try. Wish me luck :)

But one last question. Did you added stream to 192.168.1.XX:1984?

Because I have added "rtsp://192.168.1.143:554/H264/ch1/main/av_stream" to there also. (as :554 not :8554)

2022-09-12 12_17_16-go2rtc

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@cataseven Yes I have done that. Changes nothing when Home Assistant does the proxying for me, though, so it won't matter what the source is (hence why I have this question/issue open).

You added your camera to go2rtc on port 1984, but you are still using the camera's RTSP stream in Home Assistant. You should be using the URL I posted before: rtsp://192.168.1.123:8554/frontyard1 if you want to use go2rtc. Right now you're just using Home Assistant's built-in camera integration.

from go2rtc.

cataseven avatar cataseven commented on May 22, 2024

Ok, weird because I definitely couldn't see my cams away from home until I added g02rtc add on. I realIy dont understand. Anyway I will uninstall it and try. God I hope I will not ruin it everything :D Lets see :) I will feedback here

from go2rtc.

AlexxIT avatar AlexxIT commented on May 22, 2024

@mortenmoulder it's not necessary to use RTSP links to go2rtc. WebRTC doesn't depend on which RTSP link you use in Generic camera.

And external access to WebRTC doesn't depend on Android or iOS. It depends only on the network configuration. It may work from the outside if you haven't set anything up. Or it may not work. For it to work all the time - you need to set up the external access properly.

You should definitely take a closer look at the documentation.

Also you may read more tech info about WebRTC, STUN, UDP hole punching, symmetric NAT in this FAQ:
https://github.com/AlexxIT/WebRTC#faq

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@AlexxIT I have read the documentation. Let me ask you a question. Do you or Home Assistant create this URL:

https://homeassistant.domain.com/990c5500-652d-4260-b33c-0745187f6160

Random UUID/Guid. You use it inside your

The URL I posted above with the random UUID is 100% accessible from the public. The entire subdomain is accessible from the outside. When I access Home Assistant from the outside, I don't do any requests to any local IPs.

from go2rtc.

AlexxIT avatar AlexxIT commented on May 22, 2024

If you want to understand - you need to learn more about how WebRTC works.

If you don't want to configure external access for WebRTC - you can use the built-in Stream integration. It does not require additional settings for external access.

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@AlexxIT You're really not being much of a help here. If you think I'm doing something wrong, then tell me. External access work fine - my Android phone on mobile network is proof of that. It literally works as expected except on iOS devices. How can my setup be wrong, when it works on every device I own except iOS devices? Sounds like the issue is not with me, but with iOS devices or how permissions, networking, etc. is handled by Home Assistant on iOS.

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@AlexxIT I just set up an iPhone to test this. Plugged in my simcard, downloaded the HA app, and logged in. I CANNOT view the cameras while on LTE/4G, but I can immediately after I jump on WiFi.

If I do the exact same on my Android phone, I can view the cameras.

Something is not working on the iOS devices.

from go2rtc.

AlexxIT avatar AlexxIT commented on May 22, 2024

Well. Once again.

  1. Where are you trying to watch the stream? In the lovelace card or in the Web UI of the go2rtc addon?
  2. If card. What type of card you using? Picture Entity or WebRTC Camera custom?

from go2rtc.

mortenmoulder avatar mortenmoulder commented on May 22, 2024

@AlexxIT Okay, I am sorry. I misread the "But it doesn't work on iPhones" in the WebRTC documentation.

I have forwarded some UDP ports and I selected the same range in Home Assistant under the WebRTC integration. It immediately worked on my test iPhone, and my wife just replied that it works for her as well. So the problem was the ports not being forwarded and set up, so it defaulted to MSE, which the iPhone doesn't support. I'm sorry that was the issue - I thought both platforms used the same protocol, but it's clear now that they don't.

from go2rtc.

AlexxIT avatar AlexxIT commented on May 22, 2024

With go2rtc you can forward only one TCP port as described here:
https://github.com/AlexxIT/go2rtc#module-webrtc

I've been trying to explain it to you all day. But sometimes WebRTC can work without any port forwarding because built-in UDP hole punching feature.

I guess now you using WebRTC Camera integration with limited number of UDP ports.

from go2rtc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.