daniela-hase / onvif-server

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

Possible Debug Options? #2

Open kashalls opened 1 month ago

kashalls commented 1 month 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 month 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 month 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 month 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 month 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.

p10tyr commented 3 weeks ago

Was just looking around the code and there is a -d flag you can use. That currenly oly shows if something is requesting access to the camera streams.. quite basic.

I struggled with somebody else too around the networking side of things so will try and make a PR with a bit more debugging stuff to help others.

p10tyr commented 3 weeks ago

I have changed and added a lot of features in my fork repo

https://github.com/p10tyr/rtsp-to-onvif