deepch / RTSPtoWeb

RTSP Stream to WebBrowser
MIT License
1.32k stars 312 forks source link

Exposing RTSPWeb dashboard outside #269

Open avico78 opened 1 year ago

avico78 commented 1 year ago

What ports should i expose when docker network is none host one? my use case - use the RTSPWeb dashboard viewing webrtc camera stream.

at current getting error :

rtsp2web    | 2022/12/31 11:27:04 Set ICEServers [stun:stun.l.google.com:19302]
rtsp2web    | time="2022-12-31T11:27:34Z" level=error msg="WebRTC Client Offline" call=WritePacket channel=0 func=HTTPAPIServerStreamWebRTC module=http_webrtc stream=camera.front_camera
rtsp2web    | time="2022-12-31T11:27:34Z"

I guess it related to close ports which probably required , I added them in the docker compose:

networks:
  dockers_inframain:
    external: true

services:
  rtsp2web:
    container_name: rtsp2web
    image: ghcr.io/deepch/rtsptoweb:latest 
    networks:
      - dockers_inframain
    # network_mode: host
    ports:
      - 8083:8083
      # mapping udp ports for webrtc
      - 53000-53400:53000-53400
    restart: always
    volumes:
      - ./config.yaml:/config/config.json
    labels:
      traefik.enable: true
      traefik.http.routers.nvr.rule: Host(`nvr.${DOMAINNAME}`)
      traefik.http.routers.nvr.entrypoints: websecure
      traefik.http.services.nvr.loadbalancer.server.port: 8083
      traefik.http.routers.nvr.middlewares: nvr_auth
      traefik.http.middlewares.nvr_auth.basicauth.users: ${TRAEFIK_USER}:${TRAEFIK_PASS}

Also in config file:

{
  "channel_defaults": {
    "on_demand": true
  },
  "server": {
    "debug": true,
    "http_debug": false,
    "http_demo": true,
    "http_dir": "",
    "http_login": "avi",
    "http_password": "avi",
    "http_port": ":8083",
    "https": false,
    "https_auto_tls": false,
    "https_auto_tls_name": "",
    "https_cert": "",
    "https_key": "",
    "https_port": "",
    "ice_credential": "",
    "ice_servers": [
      "stun:stun.l.google.com:19302"
    ],
    "ice_username": "",
    "log_level": "info",
    "rtsp_port": ":5541",
    "token": {
      "backend": "",
      "enable": false
    },
    "webrtc_port_max": 53000,
    "webrtc_port_min": 53400
  },
  "streams": {
    "camera.front_camera": {
      "channels": {
        "0": {
          "name": "ch1",
          "on_demand": true,
          "url": "rtsp://192.168.1.113:8554/front_go2rtc"
        }
      },
      "name": "front"
    },
....
    }
  }
}

And i did open in the router: image

avico78 commented 1 year ago

Actually even internally webrtc is not started on RTSPWeb loging from PC --> Chrome -> Open Camera stream as webrtc -> nothing shown logs:


2023/01/01 08:32:55 Set ICEServers [stun:stun.l.google.com:19302]
time="2023-01-01T08:33:25Z" level=error msg="WebRTC Client Offline" call=WritePacket channel=0 func=HTTPAPIServerStreamWebRTC module=http_webrtc stream=camera.front_camera
time="2023-01-01T08:34:15Z" level=info msg="Stream exit by signal or not client" call=StreamServerRunStream channel=0 func=StreamServerRunStreamDo module=core stream=camera.front_camera
marco-bertelli commented 1 year ago

same here what port i have to expose? semms ignore min max configuration