blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.97k stars 1.73k forks source link

[Camera Support]: Using PTZ with NVR #8052

Closed Strider0 closed 1 year ago

Strider0 commented 1 year ago

Describe the problem you are having

PTZ controls do not work on my Dahua Camera through Frigate. The camera is connected to a Qsee(Dahua) NVR. I added the ONVIF settings to my config, but I am not sure how to specify the Channel the PTZ is on (15).

Version

0.13.0-0858859

Frigate config file

###Config for 192.168.x.y
mqtt:
  host: 192.168.x.y
  topic_prefix: frigate_bldg3
  # Optional: client id (default: shown below)
  # WARNING: must be unique if you are running multiple instances
  client_id: frigate_bldg3
detectors:
  coral:
    type: edgetpu
    device: usb
ffmpeg:
  hwaccel_args: preset-rpi-64-h264
go2rtc:
  streams:
    bldg3_cam8:
      - rtsp://user:Password@192.168.x.z:554/cam/realmonitor?channel=11&subtype=1
    bldg3_cam9:
      - rtsp://user:Password@192.168.x.z:554/cam/realmonitor?channel=9&subtype=1
    bldg3_cam3:
      - rtsp://user:Password@192.168.x.z:554/cam/realmonitor?channel=5&subtype=1
    bldg4_cam1:
      - rtsp://user:Password@192.168.x.x:554/cam/realmonitor?channel=1&subtype=1
    bldg3_ptz:
      - rtsp://user:Password@192.168.x.z:554/cam/realmonitor?channel=15&subtype=1

cameras:
  bldg3_cam8:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/bldg3_cam8
          roles:
            - detect
        - path: rtsp://user:Password@192.168.x.z:554/cam/realmonitor?channel=11&subtype=0
          roles:
            - record
    detect:
      width: 704
      height: 480
      fps: 5

  bldg3_cam9:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/bldg3_cam9
          roles:
            - detect
        - path: rtsp://user:Password@192.168.x.z:554/cam/realmonitor?channel=9&subtype=0
          roles:
           - record
    detect:
      width: 704
      height: 480
      fps: 5
    motion:
      mask:
        - 222,0,704,0,704,88  

  bldg3_cam3:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/bldg3_cam3
          roles:
            - detect
        - path: rtsp://user:Password@192.168.x.z:554/cam/realmonitor?channel=5&subtype=0
          roles:
           - record
    detect:
      width: 704
      height: 480
      fps: 5        

  bldg4_cam1:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/bldg4_cam1
          roles:
            - detect
        - path: rtsp://user:Password@192.168.x.x:554/cam/realmonitor?channel=1&subtype=0
          roles:
           - record
    detect:
      width: 704
      height: 480
      fps: 5
    motion:
      mask:
        - 0,0,454,0,704,0,704,135
        - 0,316,291,157,279,0,0,0

  bldg3_ptz:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/bldg3_ptz
          roles:
            - detect
        - path: rtsp://user:Password@192.168.x.z:554/cam/realmonitor?channel=15&subtype=0
          roles:
           - record
    onvif:
      host: 192.168.x.z
      port: 85
      user: user
      password: Password
    detect:
      width: 704
      height: 480
      fps: 5  

objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
  track:
    - person
    - car
    - truck
    - bear
    - dog
    - bicycle
    - motorcycle

record:
  # Optional: Enable recording (default: shown below)
  enabled: True
  # Optional: Number of days to retain (default: shown below)
  #retain_days: 0
  # Optional: Event recording settings
  events:
    # Optional: Enable event recording retention settings (default: shown below)
#    enabled: True
    # Optional: Maximum length of time to retain video during long events. (default: shown below)
    # NOTE: If an object is being tracked for longer than this amount of time, the cache
    #       will begin to expire and the resulting clip will be the last x seconds of the event unless retain_days under record is > 0.
    #max_seconds: 300
    # Optional: Number of seconds before the event to include (default: shown below)
    pre_capture: 5
    # Optional: Number of seconds after the event to include (default: shown below)
    post_capture: 5
    # Optional: Objects to save recordings for. (default: all tracked objects)
    objects:
      - person
      - car
      - bicycle
      - motorcycle
      - truck
      - bear
      - dog

    # Optional: Restrict recordings to objects that entered any of the listed zones (default: no required zones)
    required_zones: []
    # Optional: Retention settings for events
    retain:
      # Required: Default retention days (default: shown below)
      default: 10
      # Optional: Per object retention days
      objects:
        person: 30

Relevant log output

2023-10-03 10:43:37.190574999  [INFO] Preparing Frigate...
2023-10-03 10:43:37.227179448  [INFO] Starting Frigate...
2023-10-03 10:43:42.025755007  [2023-10-03 10:43:42] frigate.app                    INFO    : Starting Frigate (0.13.0-0858859)
2023-10-03 10:43:42.218283324  [2023-10-03 10:43:42] peewee_migrate.logs            INFO    : Starting migrations
2023-10-03 10:43:42.247028121  [2023-10-03 10:43:42] peewee_migrate.logs            INFO    : There is nothing to migrate
2023-10-03 10:43:42.811848740  [2023-10-03 10:43:42] frigate.app                    INFO    : Recording process started: 295
2023-10-03 10:43:42.821982713  [2023-10-03 10:43:42] frigate.app                    INFO    : go2rtc process pid: 89
2023-10-03 10:43:42.938760988  [2023-10-03 10:43:42] frigate.app                    INFO    : Output process started: 307
2023-10-03 10:43:42.942229493  [2023-10-03 10:43:42] detector.coral                 INFO    : Starting detection process: 305
2023-10-03 10:43:42.969224482  [2023-10-03 10:43:42] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-10-03 10:43:42.989311665  [2023-10-03 10:43:42] frigate.app                    INFO    : Camera processor started for bldg3_cam8: 312
2023-10-03 10:43:43.009642316  [2023-10-03 10:43:43] frigate.app                    INFO    : Camera processor started for bldg3_cam9: 313
2023-10-03 10:43:43.041932327  [2023-10-03 10:43:43] frigate.app                    INFO    : Camera processor started for bldg3_cam3: 318
2023-10-03 10:43:43.080047792  [2023-10-03 10:43:43] frigate.app                    INFO    : Camera processor started for bldg4_cam1: 321
2023-10-03 10:43:43.123546944  [2023-10-03 10:43:43] frigate.app                    INFO    : Camera processor started for bldg3_ptz: 324
2023-10-03 10:43:43.164307937  [2023-10-03 10:43:43] frigate.app                    INFO    : Capture process started for bldg3_cam8: 325
2023-10-03 10:43:43.195462316  [2023-10-03 10:43:43] frigate.app                    INFO    : Capture process started for bldg3_cam9: 330
2023-10-03 10:43:43.271027735  [2023-10-03 10:43:43] frigate.app                    INFO    : Capture process started for bldg3_cam3: 333
2023-10-03 10:43:43.271306739  [2023-10-03 10:43:43] frigate.app                    INFO    : Capture process started for bldg4_cam1: 340
2023-10-03 10:43:43.296551219  [2023-10-03 10:43:43] frigate.app                    INFO    : Capture process started for bldg3_ptz: 343
2023-10-03 10:43:45.702787969  [2023-10-03 10:43:45] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-10-03 10:45:40.372413552  [2023-10-03 10:45:40] frigate.comms.dispatcher       INFO    : Setting ptz command to move_down for bldg3_ptz
2023-10-03 10:45:40.390436104  [2023-10-03 10:45:40] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:40.568422958  [2023-10-03 10:45:40] frigate.comms.dispatcher       INFO    : Setting ptz command to move_down for bldg3_ptz
2023-10-03 10:45:40.598159050  [2023-10-03 10:45:40] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:40.660205326  [2023-10-03 10:45:40] frigate.comms.dispatcher       INFO    : Setting ptz command to move_down for bldg3_ptz
2023-10-03 10:45:40.696307304  [2023-10-03 10:45:40] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:40.811580122  [2023-10-03 10:45:40] frigate.comms.dispatcher       INFO    : Setting ptz command to move_down for bldg3_ptz
2023-10-03 10:45:40.868941116  [2023-10-03 10:45:40] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:40.966692488  [2023-10-03 10:45:40] frigate.comms.dispatcher       INFO    : Setting ptz command to move_down for bldg3_ptz
2023-10-03 10:45:41.017598149  [2023-10-03 10:45:41] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:41.128287455  [2023-10-03 10:45:41] frigate.comms.dispatcher       INFO    : Setting ptz command to move_down for bldg3_ptz
2023-10-03 10:45:41.162462269  [2023-10-03 10:45:41] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:41.296878090  [2023-10-03 10:45:41] frigate.comms.dispatcher       INFO    : Setting ptz command to move_down for bldg3_ptz
2023-10-03 10:45:41.342081869  [2023-10-03 10:45:41] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:42.371602904  [2023-10-03 10:45:42] frigate.comms.dispatcher       INFO    : Setting ptz command to zoom_out for bldg3_ptz
2023-10-03 10:45:42.428438928  [2023-10-03 10:45:42] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:42.543288640  [2023-10-03 10:45:42] frigate.comms.dispatcher       INFO    : Setting ptz command to zoom_out for bldg3_ptz
2023-10-03 10:45:42.586457622  [2023-10-03 10:45:42] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:42.698177244  [2023-10-03 10:45:42] frigate.comms.dispatcher       INFO    : Setting ptz command to zoom_out for bldg3_ptz
2023-10-03 10:45:42.759901742  [2023-10-03 10:45:42] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:42.891516103  [2023-10-03 10:45:42] frigate.comms.dispatcher       INFO    : Setting ptz command to zoom_out for bldg3_ptz
2023-10-03 10:45:42.951124429  [2023-10-03 10:45:42] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:43.049262293  [2023-10-03 10:45:43] frigate.comms.dispatcher       INFO    : Setting ptz command to zoom_out for bldg3_ptz
2023-10-03 10:45:43.100601311  [2023-10-03 10:45:43] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz
2023-10-03 10:45:43.216483765  [2023-10-03 10:45:43] frigate.comms.dispatcher       INFO    : Setting ptz command to zoom_out for bldg3_ptz
2023-10-03 10:45:43.283717334  [2023-10-03 10:45:43] frigate.comms.dispatcher       INFO    : Setting ptz command to stop for bldg3_ptz

FFprobe output from your camera

FFPROBE OUTPUT
Stream 0:
Return Code: 0

Video:

Codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Resolution: 704x576
FPS: 25/1

Stream 1:
Return Code: 0

Video:

Codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Resolution: 2560x1440
FPS: 25/1

Audio:

Codec: PCM A-law / G.711 A-law

Frigate stats

{"bldg3_cam3":{"camera_fps":5.0,"capture_pid":333,"detection_enabled":1,"detection_fps":2.0,"ffmpeg_pid":347,"pid":318,"process_fps":5.1,"skipped_fps":0.0},"bldg3_cam8":{"camera_fps":5.1,"capture_pid":325,"detection_enabled":1,"detection_fps":4.0,"ffmpeg_pid":332,"pid":312,"process_fps":5.1,"skipped_fps":0.0},"bldg3_cam9":{"camera_fps":5.1,"capture_pid":330,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":345,"pid":313,"process_fps":5.1,"skipped_fps":0.0},"bldg3_ptz":{"camera_fps":5.0,"capture_pid":343,"detection_enabled":1,"detection_fps":13.6,"ffmpeg_pid":360,"pid":324,"process_fps":5.0,"skipped_fps":0.0},"bldg4_cam1":{"camera_fps":5.0,"capture_pid":340,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":358,"pid":321,"process_fps":5.1,"skipped_fps":0.0},"cpu_usages":{"1":{"cmdline":"/package/admin/s6/command/s6-svscan -d4 -- /run/service","cpu":"0.0","cpu_average":"0","mem":"0.0"},"15":{"cmdline":"s6-supervise s6-linux-init-shutdownd","cpu":"0.0","cpu_average":"0","mem":"0.0"},"17":{"cmdline":"/package/admin/s6-linux-init/command/s6-linux-init-shutdownd -c /run/s6/basedir -g 3000 -C -B","cpu":"0.0","cpu_average":"0","mem":"0.0"},"24":{"cmdline":"s6-supervise go2rtc-healthcheck","cpu":"0.0","cpu_average":"0","mem":"0.0"},"25":{"cmdline":"s6-supervise nginx-log","cpu":"0.0","cpu_average":"0","mem":"0.0"},"26":{"cmdline":"s6-supervise go2rtc","cpu":"0.0","cpu_average":"0","mem":"0.0"},"27":{"cmdline":"s6-supervise go2rtc-log","cpu":"0.0","cpu_average":"0","mem":"0.0"},"28":{"cmdline":"s6-supervise nginx","cpu":"0.0","cpu_average":"0","mem":"0.0"},"29":{"cmdline":"s6-supervise s6rc-fdholder","cpu":"0.0","cpu_average":"0","mem":"0.0"},"30":{"cmdline":"s6-supervise frigate","cpu":"0.0","cpu_average":"0","mem":"0.0"},"31":{"cmdline":"s6-supervise frigate-log","cpu":"0.0","cpu_average":"0","mem":"0.0"},"32":{"cmdline":"s6-supervise s6rc-oneshot-runner","cpu":"0.0","cpu_average":"0","mem":"0.0"},"41":{"cmdline":"/package/admin/s6/command/s6-ipcserverd -1 -- /package/admin/s6/command/s6-ipcserver-access -v0 -E -l0 -i data/rules -- /package/admin/s6/command/s6-sudod -t 30000 -- /package/admin/s6-rc/command/s6-rc-oneshot-run -l ../.. --","cpu":"0.0","cpu_average":"0","mem":"0.0"},"42":{"cmdline":"/package/admin/s6-2.11.3.2/command/s6-fdholderd -1 -i data/rules","cpu":"0.0","cpu_average":"0","mem":"0.0"},"79":{"cmdline":"s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/nginx","cpu":"0.0","cpu_average":"0","mem":"0.0"},"81":{"cmdline":"s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/frigate","cpu":"0.0","cpu_average":"0","mem":"0.0"},"82":{"cmdline":"s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/go2rtc","cpu":"0.0","cpu_average":"0","mem":"0.0"},"89":{"cmdline":"/usr/local/go2rtc/bin/go2rtc -config=/dev/shm/go2rtc.yaml","cpu":"2.9","cpu_average":"2","mem":"0.6"},"110":{"cmdline":"python3 -u -m frigate","cpu":"15.7","cpu_average":"11","mem":"8.1"},"111":{"cmdline":"bash ./run.user go2rtc-healthcheck","cpu":"0.0","cpu_average":"0","mem":"0.1"},"119":{"cmdline":"nginx: master process nginx","cpu":"0.0","cpu_average":"0","mem":"0.3"},"145":{"cmdline":"nginx: worker process","cpu":"0.0","cpu_average":"0","mem":"0.2"},"146":{"cmdline":"nginx: worker process","cpu":"0.0","cpu_average":"0","mem":"0.2"},"147":{"cmdline":"nginx: worker process","cpu":"0.0","cpu_average":"0","mem":"0.2"},"148":{"cmdline":"nginx: worker process","cpu":"0.0","cpu_average":"0","mem":"0.2"},"293":{"cmdline":"frigate.logger       ","cpu":"0.5","cpu_average":"0","mem":"2.8"},"295":{"cmdline":"frigate.recording_manager","cpu":"44.2","cpu_average":"26","mem":"4.7"},"304":{"cmdline":"/usr/bin/python3 -c from multiprocessing.resource_tracker import main;main(47)","cpu":"0.5","cpu_average":"0","mem":"0.3"},"305":{"cmdline":"frigate.detector.coral","cpu":"18.8","cpu_average":"20","mem":"3.8"},"307":{"cmdline":"frigate.output       ","cpu":"2.8","cpu_average":"2","mem":"3.4"},"312":{"cmdline":"frigate.process:bldg3_cam8","cpu":"9.8","cpu_average":"8","mem":"3.5"},"313":{"cmdline":"frigate.process:bldg3_cam9","cpu":"3.3","cpu_average":"3","mem":"3.5"},"315":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 704x480 -i pipe: -f mpegts -s 1056x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.3"},"318":{"cmdline":"frigate.process:bldg3_cam3","cpu":"2.8","cpu_average":"7","mem":"3.5"},"320":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 704x480 -i pipe: -f mpegts -s 1056x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.3"},"321":{"cmdline":"frigate.process:bldg4_cam1","cpu":"3.3","cpu_average":"3","mem":"3.4"},"323":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 704x480 -i pipe: -f mpegts -s 1056x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.3"},"324":{"cmdline":"frigate.process:bldg3_ptz","cpu":"21.0","cpu_average":"15","mem":"3.5"},"325":{"cmdline":"frigate.capture:bldg3_cam8","cpu":"1.4","cpu_average":"1","mem":"3.2"},"329":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 704x480 -i pipe: -f mpegts -s 1056x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.3"},"330":{"cmdline":"frigate.capture:bldg3_cam9","cpu":"1.9","cpu_average":"1","mem":"3.2"},"332":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -c:v:1 h264_v4l2m2m -user_agent FFmpeg Frigate/0.13.0-0858859 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/bldg3_cam8 -r 5 -vf fps=5,scale=704:480 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:","cpu":"6.5","cpu_average":"5","mem":"0.8"},"333":{"cmdline":"frigate.capture:bldg3_cam3","cpu":"2.3","cpu_average":"1","mem":"3.2"},"337":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 704x480 -i pipe: -f mpegts -s 1056x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.3"},"340":{"cmdline":"frigate.capture:bldg4_cam1","cpu":"1.9","cpu_average":"1","mem":"3.2"},"342":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -c:v:1 h264_v4l2m2m -user_agent FFmpeg Frigate/0.13.0-0858859 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://alarm:Qalarmz1%21@192.168.50.230:554/cam/realmonitor?channel=11&subtype=0 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/bldg3_cam8-%Y%m%d%H%M%S.mp4","cpu":"1.9","cpu_average":"1","mem":"0.6"},"343":{"cmdline":"frigate.capture:bldg3_ptz","cpu":"1.9","cpu_average":"1","mem":"3.2"},"345":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -c:v:1 h264_v4l2m2m -user_agent FFmpeg Frigate/0.13.0-0858859 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/bldg3_cam9 -r 5 -vf fps=5,scale=704:480 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:","cpu":"7.0","cpu_average":"6","mem":"0.8"},"346":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1280x720 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.3"},"347":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -c:v:1 h264_v4l2m2m -user_agent FFmpeg Frigate/0.13.0-0858859 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/bldg3_cam3 -r 5 -vf fps=5,scale=704:480 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:","cpu":"6.1","cpu_average":"6","mem":"0.8"},"356":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -c:v:1 h264_v4l2m2m -user_agent FFmpeg Frigate/0.13.0-0858859 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://alarm:Qalarmz1%21@192.168.50.230:554/cam/realmonitor?channel=5&subtype=0 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/bldg3_cam3-%Y%m%d%H%M%S.mp4","cpu":"2.3","cpu_average":"2","mem":"0.6"},"357":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -c:v:1 h264_v4l2m2m -user_agent FFmpeg Frigate/0.13.0-0858859 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://alarm:Qalarmz1%21@192.168.50.230:554/cam/realmonitor?channel=9&subtype=0 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/bldg3_cam9-%Y%m%d%H%M%S.mp4","cpu":"2.3","cpu_average":"2","mem":"0.6"},"358":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -c:v:1 h264_v4l2m2m -user_agent FFmpeg Frigate/0.13.0-0858859 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/bldg4_cam1 -r 5 -vf fps=5,scale=704:480 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:","cpu":"6.0","cpu_average":"5","mem":"0.8"},"360":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -c:v:1 h264_v4l2m2m -user_agent FFmpeg Frigate/0.13.0-0858859 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/bldg3_ptz -r 5 -vf fps=5,scale=704:480 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:","cpu":"17.7","cpu_average":"15","mem":"0.8"},"371":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -c:v:1 h264_v4l2m2m -user_agent FFmpeg Frigate/0.13.0-0858859 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://alarm:Qalarmz1%21@192.168.50.68:554/cam/realmonitor?channel=1&subtype=0 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/bldg4_cam1-%Y%m%d%H%M%S.mp4","cpu":"3.3","cpu_average":"3","mem":"0.6"},"372":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -c:v:1 h264_v4l2m2m -user_agent FFmpeg Frigate/0.13.0-0858859 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://alarm:Qalarmz1%21@192.168.50.230:554/cam/realmonitor?channel=15&subtype=0 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/bldg3_ptz-%Y%m%d%H%M%S.mp4","cpu":"3.7","cpu_average":"3","mem":"0.6"},"2093":{"cmdline":"sleep 30s","cpu":"0.0","cpu_average":"0","mem":"0.0"}},"detection_fps":19.6,"detectors":{"coral":{"detection_start":0.0,"inference_speed":21.23,"pid":305}},"gpu_usages":{"rpi-v4l2m2m":{"gpu":-1,"mem":-1}},"processes":{"go2rtc":{"pid":89},"logger":{"pid":293},"recording":{"pid":295}},"service":{"last_updated":1696355699,"latest_version":"0.12.1","storage":{"/dev/shm":{"free":122.4,"mount_type":"tmpfs","total":128.0,"used":5.6},"/media/frigate/clips":{"free":40706.4,"mount_type":"ext4","total":59664.4,"used":16500.4},"/media/frigate/recordings":{"free":40706.4,"mount_type":"ext4","total":59664.4,"used":16500.4},"/tmp/cache":{"free":914.5,"mount_type":"tmpfs","total":953.7,"used":39.1}},"temperatures":{},"uptime":676,"version":"0.13.0-0858859"}}

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Dahua SD59432XA-HNR

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

@hawkeye217 any ideas on this?

hawkeye217 commented 1 year ago

I would assume the Dahua NVR sends ONVIF commands directly to the camera rather than through some proprietary protocol (especially since it's Dahua).

Since the camera itself is what supports ONVIF, I'd suggest just using to the camera's IP (rather than your NVR) for the ONVIF section of your frigate config.

ONVIF commands will be more responsive when connecting to the camera directly rather than proxying them through the NVR anyways.

Strider0 commented 1 year ago

@hawkeye217 Thanks for the response and your great work on Frigate! Unfortunately I cannot use the camera IP since the camera is not accessible to Frigate. In my setup the cameras are plugged into the back of the NVR and get power and configuration from the NVR (as well as private IP addresses issued by the NVR that isn't directly accessible). When configuring the cameras in Frigate I specify the NVR IP and the channel the camera is on. Is there a way to specify the channel in the ONVIF configuration? I believe the NVR supports the functionality since I can connect to it with ONVIF Device Manager, select the channel and control the camera.

hawkeye217 commented 1 year ago

@hawkeye217 Thanks for the response and your great work on Frigate! Unfortunately I cannot use the camera IP since the camera is not accessible to Frigate. In my setup the cameras are plugged into the back of the NVR and get power and configuration from the NVR (as well as private IP addresses issued by the NVR that isn't directly accessible). When configuring the cameras in Frigate I specify the NVR IP and the channel the camera is on. Is there a way to specify the channel in the ONVIF configuration? I believe the NVR supports the functionality since I can connect to it with ONVIF Device Manager, select the channel and control the camera.

Gotcha, sorry I misunderstood!

Could you add this to your frigate config file and send me the debug output that gets generated on restart?

logger:
  default: info
  logs:
    frigate.ptz.onvif: debug
hawkeye217 commented 1 year ago

By the way, I should mention that you'll need a recent dev build to get that debug info.

Strider0 commented 1 year ago

Yes, here it is:

2023-10-22 18:46:47.247795852 [2023-10-22 18:46:47] frigate.ptz.onvif DEBUG : Onvif config for bldg3_ptz: { 2023-10-22 18:46:47.247809573 'Spaces': { 2023-10-22 18:46:47.247823777 'AbsolutePanTiltPositionSpace': [ 2023-10-22 18:46:47.247827665 { 2023-10-22 18:46:47.247832110 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace', 2023-10-22 18:46:47.247834517 'XRange': { 2023-10-22 18:46:47.247836554 'Min': -1.0, 2023-10-22 18:46:47.247877349 'Max': 1.0 2023-10-22 18:46:47.247879534 }, 2023-10-22 18:46:47.247883071 'YRange': { 2023-10-22 18:46:47.247884978 'Min': -1.0, 2023-10-22 18:46:47.247887034 'Max': 1.0 2023-10-22 18:46:47.247888626 } 2023-10-22 18:46:47.247891719 } 2023-10-22 18:46:47.247893256 ], 2023-10-22 18:46:47.247895255 'AbsoluteZoomPositionSpace': [ 2023-10-22 18:46:47.247949920 { 2023-10-22 18:46:47.247954865 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace', 2023-10-22 18:46:47.247980419 'XRange': { 2023-10-22 18:46:47.247982956 'Min': 0.0, 2023-10-22 18:46:47.247984771 'Max': 1.0 2023-10-22 18:46:47.247986660 } 2023-10-22 18:46:47.247988178 } 2023-10-22 18:46:47.247989678 ], 2023-10-22 18:46:47.247991808 'RelativePanTiltTranslationSpace': [], 2023-10-22 18:46:47.247994030 'RelativeZoomTranslationSpace': [], 2023-10-22 18:46:47.247996122 'ContinuousPanTiltVelocitySpace': [ 2023-10-22 18:46:47.247997641 { 2023-10-22 18:46:47.248000585 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace', 2023-10-22 18:46:47.248030510 'XRange': { 2023-10-22 18:46:47.248033177 'Min': -1.0, 2023-10-22 18:46:47.248035065 'Max': 1.0 2023-10-22 18:46:47.248036676 }, 2023-10-22 18:46:47.248038510 'YRange': { 2023-10-22 18:46:47.248040843 'Min': -1.0, 2023-10-22 18:46:47.248042639 'Max': 1.0 2023-10-22 18:46:47.248044213 } 2023-10-22 18:46:47.248045750 } 2023-10-22 18:46:47.248047232 ], 2023-10-22 18:46:47.248049306 'ContinuousZoomVelocitySpace': [ 2023-10-22 18:46:47.248082342 { 2023-10-22 18:46:47.248086156 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace', 2023-10-22 18:46:47.248088027 'XRange': { 2023-10-22 18:46:47.248089915 'Min': -1.0, 2023-10-22 18:46:47.248091730 'Max': 1.0 2023-10-22 18:46:47.248093674 } 2023-10-22 18:46:47.248095174 } 2023-10-22 18:46:47.248096656 ], 2023-10-22 18:46:47.248098508 'PanTiltSpeedSpace': [], 2023-10-22 18:46:47.248100322 'ZoomSpeedSpace': [], 2023-10-22 18:46:47.248102082 'Extension': None, 2023-10-22 18:46:47.248103748 '_attr_1': None 2023-10-22 18:46:47.248105359 }, 2023-10-22 18:46:47.248107081 'PTZTimeout': { 2023-10-22 18:46:47.248109174 'Min': datetime.timedelta(seconds=1), 2023-10-22 18:46:47.248111341 'Max': datetime.timedelta(seconds=250) 2023-10-22 18:46:47.248112803 }, 2023-10-22 18:46:47.248114563 '_value_1': None, 2023-10-22 18:46:47.248116414 'PTControlDirection': None, 2023-10-22 18:46:47.248118081 'Extension': None, 2023-10-22 18:46:47.248158339 '_attr_1': None 2023-10-22 18:46:47.248160598 }

hawkeye217 commented 1 year ago

Great. Unfortunately this doesn't tell me too much.

The more recent builds actually have more onvif debug info. Any chance you can upgrade?

Strider0 commented 1 year ago

My mistake. I thought I was on v0.13.0-beta2 / the latest build. Probably a rookie question...But where do I find a more current one?

hawkeye217 commented 1 year ago

You're on the latest released beta. The dev builds are available here.

I think we're fairly close to beta 3, if you'd prefer to wait.

Strider0 commented 1 year ago

Upgraded to: dev-e9376ca-rpi 2023-10-22 19:23:54.264253028 [2023-10-22 19:23:54] frigate.ptz.onvif DEBUG : Onvif configs for bldg3_ptz: { 2023-10-22 19:23:54.264265584 'Name': 'PTZConfig_Channel2', 2023-10-22 19:23:54.264267917 'UseCount': 2, 2023-10-22 19:23:54.264270158 'NodeToken': '00100', 2023-10-22 19:23:54.264284991 'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace', 2023-10-22 19:23:54.264320103 'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace', 2023-10-22 19:23:54.264323565 'DefaultRelativePanTiltTranslationSpace': None, 2023-10-22 19:23:54.264327251 'DefaultRelativeZoomTranslationSpace': None, 2023-10-22 19:23:54.264330658 'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace', 2023-10-22 19:23:54.264397010 'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace', 2023-10-22 19:23:54.264400140 'DefaultPTZSpeed': None, 2023-10-22 19:23:54.264402473 'DefaultPTZTimeout': datetime.timedelta(seconds=10), 2023-10-22 19:23:54.264406084 'PanTiltLimits': None, 2023-10-22 19:23:54.264407843 'ZoomLimits': None, 2023-10-22 19:23:54.264409547 'Extension': None, 2023-10-22 19:23:54.264434529 'token': '00100', 2023-10-22 19:23:54.264436955 '_attr_1': { 2023-10-22 19:23:54.264438658 'MoveRamp': '0', 2023-10-22 19:23:54.264440362 'PresetRamp': '0', 2023-10-22 19:23:54.264442399 'PresetTourRamp': '0' 2023-10-22 19:23:54.264443769 } 2023-10-22 19:23:54.264445177 } 2023-10-22 19:23:54.419173926 [2023-10-22 19:23:54] frigate.ptz.onvif DEBUG : Onvif config for bldg3_ptz: { 2023-10-22 19:23:54.419184667 'Spaces': { 2023-10-22 19:23:54.419187297 'AbsolutePanTiltPositionSpace': [ 2023-10-22 19:23:54.419189278 { 2023-10-22 19:23:54.419192371 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace', 2023-10-22 19:23:54.419194371 'XRange': { 2023-10-22 19:23:54.419196352 'Min': -1.0, 2023-10-22 19:23:54.419198204 'Max': 1.0 2023-10-22 19:23:54.419199797 }, 2023-10-22 19:23:54.419201537 'YRange': { 2023-10-22 19:23:54.419203371 'Min': -1.0, 2023-10-22 19:23:54.419205149 'Max': 1.0 2023-10-22 19:23:54.419206704 } 2023-10-22 19:23:54.419208223 } 2023-10-22 19:23:54.419209741 ], 2023-10-22 19:23:54.419211723 'AbsoluteZoomPositionSpace': [ 2023-10-22 19:23:54.419213297 { 2023-10-22 19:23:54.419216167 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace', 2023-10-22 19:23:54.419217982 'XRange': { 2023-10-22 19:23:54.419219852 'Min': 0.0, 2023-10-22 19:23:54.419221667 'Max': 1.0 2023-10-22 19:23:54.419223241 } 2023-10-22 19:23:54.419224741 } 2023-10-22 19:23:54.419226241 ], 2023-10-22 19:23:54.419228334 'RelativePanTiltTranslationSpace': [], 2023-10-22 19:23:54.419230408 'RelativeZoomTranslationSpace': [], 2023-10-22 19:23:54.419232445 'ContinuousPanTiltVelocitySpace': [ 2023-10-22 19:23:54.419233963 { 2023-10-22 19:23:54.419323186 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace', 2023-10-22 19:23:54.419325964 'XRange': { 2023-10-22 19:23:54.419327871 'Min': -1.0, 2023-10-22 19:23:54.419330501 'Max': 1.0 2023-10-22 19:23:54.419332130 }, 2023-10-22 19:23:54.419333890 'YRange': { 2023-10-22 19:23:54.419335723 'Min': -1.0, 2023-10-22 19:23:54.419337501 'Max': 1.0 2023-10-22 19:23:54.419340945 } 2023-10-22 19:23:54.419342464 } 2023-10-22 19:23:54.419344038 ], 2023-10-22 19:23:54.419346075 'ContinuousZoomVelocitySpace': [ 2023-10-22 19:23:54.419347649 { 2023-10-22 19:23:54.419350630 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace', 2023-10-22 19:23:54.419385668 'XRange': { 2023-10-22 19:23:54.419388371 'Min': -1.0, 2023-10-22 19:23:54.419390186 'Max': 1.0 2023-10-22 19:23:54.419391760 } 2023-10-22 19:23:54.419393279 } 2023-10-22 19:23:54.419394834 ], 2023-10-22 19:23:54.419396668 'PanTiltSpeedSpace': [], 2023-10-22 19:23:54.419398908 'ZoomSpeedSpace': [], 2023-10-22 19:23:54.419400631 'Extension': None, 2023-10-22 19:23:54.419402297 '_attr_1': None 2023-10-22 19:23:54.419403797 }, 2023-10-22 19:23:54.419405519 'PTZTimeout': { 2023-10-22 19:23:54.419407982 'Min': datetime.timedelta(seconds=1), 2023-10-22 19:23:54.419410112 'Max': datetime.timedelta(seconds=250) 2023-10-22 19:23:54.419430908 }, 2023-10-22 19:23:54.419433427 '_value_1': None, 2023-10-22 19:23:54.419435297 'PTControlDirection': None, 2023-10-22 19:23:54.419436964 'Extension': None, 2023-10-22 19:23:54.419438557 '_attr_1': None 2023-10-22 19:23:54.419439871 }

hawkeye217 commented 1 year ago

Thanks!

It doesn't look like there's an initially obvious way to make Frigate's PTZ work with your NVR. I don't have a way of testing and trying things myself, and I don't think any of the other maintainers have an NVR to test with either.

We can table this and possibly revisit at a later date if the situation changes.

NickM-27 commented 1 year ago

Closing this as not planned, the currently used library does not support this