AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
4.65k stars 378 forks source link

Connection issue rtsp.go: read tcp ... i/o timeout #1064

Open mrmiles156 opened 5 months ago

mrmiles156 commented 5 months ago

I hope someone can help me, I have Frigate installed in a docker container and I can see all my camera's in the Frigate Webui and home assistant. but I can't connect to the rtsp feed that go2rtc via VLC (Your input can't be opened) VLC is unable to open the VLC is unable to open the MRL 'rtsp://192.168.16.203:8554/front_drive

My Frigate config lookes like this

go2rtc:
  streams:
    Front_Drive: # <- for RTSP streams
      - rtsp://192.168.15.11:554/stream0
     # - "ffmpeg:Front_Drive#video=h264"
    Front_Drive_Sub:
      - rtsp://192.168.15.11:554/stream1
     # - "ffmpeg:Front_Drive_Sub#video=h264"

  Front_Drive:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/Front_Drive
          input_args: preset-rtsp-restream
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/Front_Drive_Sub
          input_args: preset-rtsp-restream
          roles:
            - detect
    detect:    
      width: 1280
      height: 720
      fps: 5
    objects:
      track:
        - person
        - car
      filters:  
        person:
          threshold: 0.7
    snapshots:
      required_zones:
        - Front_Drive_Driveway
      enabled: true
      timestamp: false
      bounding_box: true
      retain:
        default: 5 
    record:
      enabled: true
      retain:
        days: 5
      events:
        required_zones:
          - Front_Drive_Driveway
        pre_capture: 5
        post_capture: 5
        retain:
          default: 5

with the the Frigate Webui under Logs > Go2rtc i get the following error

2024-04-27 08:40:06.337838321  [INFO] Preparing new go2rtc config...
2024-04-27 08:40:06.740485290  [INFO] Starting go2rtc...
2024-04-27 08:40:06.861664709  08:40:06.861 INF go2rtc version 1.8.4 linux/amd64
2024-04-27 08:40:06.862180571  08:40:06.862 INF [api] listen addr=:1984
2024-04-27 08:40:06.862384338  08:40:06.862 INF [rtsp] listen addr=:8554
2024-04-27 08:40:06.862637174  08:40:06.862 INF [webrtc] listen addr=:8555
2024-04-27 08:40:16.333096539  [INFO] Starting go2rtc healthcheck service...
2024-04-27 08:57:37.959295803  08:57:37.959 WRN github.com/AlexxIT/go2rtc/internal/rtsp/rtsp.go:225 > error="read tcp 192.168.208.2:8554->192.168.208.1:41188: i/o timeout"

192.168.208.0 seems to be the docker bridge network. I can see .1 being the the gateway

Where am I going wrong?

AlexxIT commented 5 months ago

You have very complex network setup. It's only up to you to find the problem. 192.168.16.203 - address of your server from your PC 192.168.208.2 - address of your server (according to go2rtc) 192.168.208.1 - address of your PC (according to go2rtc)

"i/o timeout" - can only mean one thing - timeout for reading or writing to the network

mrmiles156 commented 5 months ago

How should I have this setup?, as I think i used the default

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:stable
    shm_size: "512mb" # update for your cameras based on calculation above
    devices:
      - /dev/bus/usb:/dev/bus/usb  # Passes the USB Coral, needs to be modified for other versions
      - /dev/apex_0:/dev/apex_0    # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
      - /dev/video11:/dev/video11  # For Raspberry Pi 4B
      - /dev/dri/renderD128:/dev/dri/renderD128 # For intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime:ro"
      - /volume3/docker/frigate/config:/config
      - /volume2/Backup/frigate:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "8001:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD:
AlexxIT commented 5 months ago

I don't know. Personally, I don't give myself any problems with different home subnets. Even VPN access to the home network falls into the same subnet.

mrmiles156 commented 5 months ago

OK, so you are suggesting that this Go2rtc rtsp url is not to access rstp url on the camera? rtsp://127.0.0.1:8554/Front_Drive

rtsp://192.168.15.11:554/stream0

or my rtsp://192.168.16.203:8554/front_drive is the wrong url?

AlexxIT commented 5 months ago

It's just connection issue. The problem is in your home network setup