blakeblackshear / frigate

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

[Support]: Unable to Record / Track Events #7869

Closed AddoSolutions closed 1 year ago

AddoSolutions commented 1 year ago

Describe the problem you are having

Hello, I have been racking my head against this, and have been totally unable to get the system to record.

It does clearly identify objects, so that part works, but it won't record. The source video is from a Bosch IP camera

Version

ghcr.io/blakeblackshear/frigate:0.13.0-beta1-tensorrt

Frigate config file

mqtt:
  enabled: True
  host: mqtt

snapshots:
  # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
  enabled: True

logger:
  # Optional: Default log verbosity (default: shown below)
  default: debug

  # Optional: Component specific logger overrides
  logs:
    default: debug

ffmpeg:
  global_args: -hide_banner -loglevel debug -threads 2

cameras:
  front_door: # <------ Name the camera
    mqtt:
      timestamp: False
      bounding_box: False
      crop: True
      quality: 100
      height: 500
    ffmpeg:
      inputs:
        - path: rtsp://1.2.3.4:554/rtsp_tunnel?p=0&h26x=4&aon=1&aud=1 # <----- The stream you want to use for detection
          roles:
            - detect
            - record
      hwaccel_args: preset-nvidia-h264
    detect:
      enabled: True # <---- disable detection until you have a working camera feed
      width: 1920 # <---- update for your camera's resolution
      height: 1080 # <---- update for your camera's resolution
    snapshots: # <----- Enable snapshots
      enabled: True
    motion:
      mask:
        - 1023,153,368,349,997,541,212,1080,1920,1080,1833,344

detectors:
  tensorrt:
    type: tensorrt
#    device: 0 #This is the default, select the first GPU

record:
  enabled: True

model:
  path: /config/model_cache/tensorrt/yolov7-320.trt
 #path: /trt-models/yolov7-tiny-416.trt
  input_tensor: nchw
  input_pixel_format: rgb
  width: 416
  height: 416

Relevant log output

2023-09-18 12:42:57.618059149  [2023-09-18 12:42:57] frigate.record.maintainer      ERROR   : Error occurred when attempting to maintain recording cache
2023-09-18 12:42:57.618156327  [2023-09-18 12:42:57] frigate.record.maintainer      ERROR   : list index out of range

FFprobe output from your camera

ffprobe version n5.1-2-g915ef932a3-20220731 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-mbedtls --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags=-pie --extra-libs='-ldl -lgomp' --extra-version=20220731
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, rtsp, from 'rtsp://1.2.3.4:554/rtsp_tunnel?p=0':
  Metadata:
    title           : LIVE VIEW
  Duration: N/A, start: -0.066644, bitrate: N/A
  Stream #0:0: Video: h264 (Main), yuv420p(tv, bt470bg/bt709/bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn

Frigate stats

// 20230918124729
// http://10.10.12.145:5000/api/stats

{
  "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"
    },
    "16": {
      "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 frigate",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "25": {
      "cmdline": "s6-supervise s6rc-oneshot-runner",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "26": {
      "cmdline": "s6-supervise frigate-log",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "27": {
      "cmdline": "s6-supervise nginx",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "28": {
      "cmdline": "s6-supervise nginx-log",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "29": {
      "cmdline": "s6-supervise go2rtc",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "30": {
      "cmdline": "s6-supervise s6rc-fdholder",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "31": {
      "cmdline": "s6-supervise go2rtc-log",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "32": {
      "cmdline": "s6-supervise go2rtc-healthcheck",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "43": {
      "cmdline": "/package/admin/s6-2.11.3.2/command/s6-fdholderd -1 -i data/rules",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "44": {
      "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"
    },
    "87": {
      "cmdline": "s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/go2rtc",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "93": {
      "cmdline": "s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/frigate",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "94": {
      "cmdline": "s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/nginx",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "98": {
      "cmdline": "/usr/local/go2rtc/bin/go2rtc -config=/dev/shm/go2rtc.yaml",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.1"
    },
    "111": {
      "cmdline": "bash ./run.user go2rtc-healthcheck",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "114": {
      "cmdline": "python3 -u -m frigate",
      "cpu": "0.4",
      "cpu_average": "1",
      "mem": "1.0"
    },
    "123": {
      "cmdline": "nginx: master process nginx",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "151": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "152": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "153": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "154": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "155": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "162": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "168": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "178": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "195": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "225": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "249": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "283": {
      "cmdline": "nginx: worker process",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "602": {
      "cmdline": "frigate.logger       ",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.5"
    },
    "604": {
      "cmdline": "frigate.recording_manager",
      "cpu": "0.7",
      "cpu_average": "0",
      "mem": "0.6"
    },
    "613": {
      "cmdline": "/usr/bin/python3 -c from multiprocessing.resource_tracker import main;main(39)",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "614": {
      "cmdline": "frigate.detector.tensorrt",
      "cpu": "5.7",
      "cpu_average": "7",
      "mem": "3.6"
    },
    "615": {
      "cmdline": "frigate.output       ",
      "cpu": "0.4",
      "cpu_average": "0",
      "mem": "0.6"
    },
    "619": {
      "cmdline": "frigate.process:front_door",
      "cpu": "16.6",
      "cpu_average": "22",
      "mem": "0.6"
    },
    "621": {
      "cmdline": "frigate.capture:front_door",
      "cpu": "3.1",
      "cpu_average": "2",
      "mem": "0.6"
    },
    "623": {
      "cmdline": "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.1"
    },
    "627": {
      "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.1"
    },
    "628": {
      "cmdline": "ffmpeg -hide_banner -loglevel debug -threads 2 -hwaccel cuda -hwaccel_output_format cuda -user_agent FFmpeg Frigate/0.13.0-9185753 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://10.10.5.2:554/rtsp_tunnel?p=0&h26x=4&aon=1&aud=1 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/front_door-%Y%m%d%H%M%S.mp4 -r 5 -vf fps=5,scale_cuda=w=1920:h=1080:format=nv12,hwdownload,format=nv12,format=yuv420p -threads 2 -f rawvideo -pix_fmt yuv420p pipe:",
      "cpu": "4.4",
      "cpu_average": "3",
      "mem": "0.7"
    },
    "898": {
      "cmdline": "bash",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    },
    "987": {
      "cmdline": "sleep 30s",
      "cpu": "0.0",
      "cpu_average": "0",
      "mem": "0.0"
    }
  },
  "detection_fps": 4.8,
  "detectors": {
    "tensorrt": {
      "detection_start": 0.0,
      "inference_speed": 7.6,
      "pid": 614
    }
  },
  "front_door": {
    "camera_fps": 5.1,
    "capture_pid": 621,
    "detection_enabled": 1,
    "detection_fps": 4.8,
    "ffmpeg_pid": 628,
    "pid": 619,
    "process_fps": 5.1,
    "skipped_fps": 0.0
  },
  "gpu_usages": {
    "NVIDIA TITAN Xp": {
      "gpu": "1.0%",
      "mem": "7.82%"
    }
  },
  "processes": {
    "go2rtc": {
      "pid": 98
    },
    "logger": {
      "pid": 602
    },
    "recording": {
      "pid": 604
    }
  },
  "service": {
    "last_updated": 1695055649,
    "latest_version": "0.12.1",
    "storage": {
      "/dev/shm": {
        "free": 60.1,
        "mount_type": "tmpfs",
        "total": 64.0,
        "used": 3.9
      },
      "/media/frigate/clips": {
        "free": 37271.7,
        "mount_type": "ext4",
        "total": 63235.6,
        "used": 22720.0
      },
      "/media/frigate/recordings": {
        "free": 37271.7,
        "mount_type": "ext4",
        "total": 63235.6,
        "used": 22720.0
      },
      "/tmp/cache": {
        "free": 37271.7,
        "mount_type": "overlay",
        "total": 63235.6,
        "used": 22720.0
      }
    },
    "temperatures": {

    },
    "uptime": 244,
    "version": "0.13.0-9185753"
  }
}

Operating system

Debian

Install method

Docker Compose

Coral version

Other

Network connection

Wired

Camera make and model

FLEXIDOME IP dynamic 7000 VR (CPP4) NIN-932-VxxIP

Any other information that may be helpful

Running NVIDIA Titan XP

NickM-27 commented 1 year ago
model:
  path: /config/model_cache/tensorrt/yolov7-320.trt
 #path: /trt-models/yolov7-tiny-416.trt
  input_tensor: nchw
  input_pixel_format: rgb
  width: 416
  height: 416

your model config is wrong, you are using a 320x320 model but configured it with a height/width of 416

AddoSolutions commented 1 year ago

Just changed:

YOLO_MODELS= yolov7x-640

and

model:
  path: /config/model_cache/tensorrt/yolov7x-640.trt
 #path: /trt-models/yolov7-tiny-416.trt
  input_tensor: nchw
  input_pixel_format: rgb
  width: 640
  height: 640

... and that did the trick. Thanks!

NickM-27 commented 1 year ago

Feel free to create a new issue if something else comes up