daniela-hase / onvif-server

Virtual Onvif Server - Add support for multichannel Onvif cameras to Unifi Protect!
MIT License
12 stars 0 forks source link

Possible Debug Options? #2

Open kashalls opened 1 day ago

kashalls commented 1 day ago

Is there any debug options possible? I was trying to get a rtsp stream from go2rtc to convert a h264 stream from a USB Camera to RTSP and using this to wrap it for UniFi Protect. Protect see's the camera, but it is hard stuck on the snapshot image. Shows as H264 stream, not sure what to go from here.

9yCQMgU image

kashalls commented 1 day ago

config.yaml

onvif:
  - mac: d8:3a:dd:15:83:a9
    ports:
      server: 8081                                # The port for the server to run on
      rtsp: 8554                                  # The port for the stream passthrough, leave this at 8554
    name: MyRTSPStream                            # A user define name
    uuid: 1714a629-ebe6-4bb8-a430-c18ffd8fa5f6    # A randomly chosen UUID (see below)
    highQuality:
      rtsp: /usb2?mp4                           # The RTSP Path
      width: 1280                                 # The Video Width
      height: 720                                # The Video Height
      framerate: 10                               # The Video Framerate/FPS
      bitrate: 1024                               # The Video Bitrate in kb/s
      quality: 4                                  # Quality, leave this as 4 for the high quality stream.
    lowQuality:
      rtsp: /usb2?mp4                           # The RTSP Path
      width: 1280                                 # The Video Width
      height: 720                                # The Video Height
      framerate: 10                               # The Video Framerate/FPS
      bitrate: 1024                               # The Video Bitrate in kb/s
      quality: 1                                  # Quality, leave this as 1 for the low quality stream.
    target:
      hostname: 127.0.0.1                      # The Hostname of the RTSP stream
      ports:
        rtsp: 5546                                 # The Port of the RTSP stream

go2rtc.yaml

streams:
  usb2: ffmpeg:device?video=/dev/video0&video_size=1280x720#video=h264#hardware
rtsp:
  listen: ":5546"
daniela-hase commented 1 day ago

That little window that pops up in Unifi Protect when you click on the preview image of a Camera for some reason always only shows the Snapshots.

Try looking at your Camera in the Dashboard or actual Playback view - does it show your stream correctly there? :)

kashalls commented 1 day ago

Try looking at your Camera in the Dashboard or actual Playback view - does it show your stream correctly there? :)

Tried that already. Go2rtc has a counter for open streams, it is always 0

kashalls commented 1 day ago

Is it possible to add some debug logging that can be enabled with a --debug flag or environment variable? Some options would be nice to see if UniFi is actually reaching the tcp proxy or if the proxy actually is able to forward to the rtsp source.