deepch / RTSPtoWeb

RTSP Stream to WebBrowser
MIT License
1.18k stars 284 forks source link

HA + RTSPtoWeb in docker /stream = 404 #103

Open luzik opened 2 years ago

luzik commented 2 years ago

Yesterday I updated home assistant, re-created new docker image using

  rtsp-to-web:
    image: ghcr.io/deepch/rtsptoweb:latest
    container_name: rtsp-to-web
    restart: unless-stopped
    network_mode: host

then successfully re-added rtsptoweb integration, but stream did not appear in rtsp-to-web demo page, and home-assistant when accessing cameras shows

Error handling WebRTC offer: RTSPtoWebRTC server failure: Not Found

I did test in without virtualization just clone and exec ..and its working

weblogs

startup:

rtsp-to-web                | [GIN-debug] Listening and serving HTTP on :8083
rtsp-to-web                | [GIN] 2022/02/20 - 18:14:56 | 200 |     2.78774ms | 192.168.123.241 | GET      "/"

adding integration in HA:

rtsp-to-web                | [GIN-debug] redirecting request 301: /static/ --> /static/
rtsp-to-web                | [GIN] 2022/02/20 - 18:15:52 | 200 |      329.65µs |     172.18.0.17 | GET      "/static/"
rtsp-to-web                | [GIN] 2022/02/20 - 18:15:52 | 401 |       10.35µs |     172.18.0.17 | GET      "/streams"
rtsp-to-web                | [GIN-debug] redirecting request 301: /static/ --> /static/
rtsp-to-web                | [GIN] 2022/02/20 - 18:15:52 | 200 |     288.392µs |     172.18.0.17 | GET      "/static/"

accessing stream in HA:

rtsp-to-web | [GIN] 2022/02/20 - 18:16:23 | 404 | 2.555µs | 172.18.0.17 | POST "/stream"

allenporter commented 2 years ago

I have a guess: the default for this server is to have HTTP Basic Auth turned on in the default config.json, so if your server RTSPtoWeb server url is http://example.com/ then you may need to specify http://demo:demo@example.com/ as the home assistant url. Alternatively, you can supply your own config.json with an empty login and password.

I think this is not a bug with RTSPtoWeb but the combination of trying to make these things integrate with each other

luzik commented 2 years ago

Yeah, that was the case !

So in my humble opinion there is default values/documentation issue. When using default config via docker, users do not know defaults credentials, and don't know what to write into HA integration configuration. Also, there is no error while adding integration with wrong credentials - it should be

Solutions :

  1. HA integration should always try default RTSPtoWeb credentials if used did not provide any.
  2. Change default credentials to empty
  3. provide HA integration example with http://demo:demo@IP , documentation need it too
allenporter commented 2 years ago

Yes, I would love this if you updated the documentation. Thank you very much!

ranrinc commented 2 years ago

Yeah, that was the case !

So in my humble opinion there is default values/documentation issue. When using default config via docker, users do not know defaults credentials, and don't know what to write into HA integration configuration. Also, there is no error while adding integration with wrong credentials - it should be

Solutions :

  1. HA integration should always try default RTSPtoWeb credentials if used did not provide any.
  2. Change default credentials to empty
  3. provide HA integration example with http://demo:demo@IP , documentation need it too

Any chances you can share your config.json since I'm trying to run it on its own docker LXC container. But so far it did not work. Also trying to make it, so I can run it on HTTPS:// using selfsign certs. Thanks