blakeblackshear / frigate

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

[Support]: Events on certain camera not playable/downloadable #3959

Closed jokakilla closed 2 years ago

jokakilla commented 2 years ago

Describe the problem you are having

First of all thanks for this amazing piece of software :) Even without Coral TPU it's working very fine without much CPU load in my scenario.

I'm using two very similar cameras (Lupus LE221 and LE228) with same video settings.

The issue: Events/recordings from the LE228 (camera "haustuer, 192.168.1.244) can't be played back from browser (Firefox and Chromium). Also downloading event clips (event download button, download clip) isn't working

When selecting an event or recording the message "The media could not be loaded, either because the server or network failed or because the format is not supported." is shown. Firefox debug console shows 503 Service unavailable for master.m3u8. Debug output from VideoJs: "VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or network failed or because the format is not supported. "

When trying to download an event clip (select event, download icon, download clip) it takes very long (like 30 seconds or so) until it download a completely wrong video even though the url is looking fine (https://mydomain//api/events/1664301007.338933-w2ps5p/clip.mp4?download=true). In this case after 27sec it downloaded the clip with id clip_haustuer_1664301002.338933-1664301037.748637. Downloading the snapshot is working without any issue.

It does not happen for the other camera even though both are configured the same way: Main (record stream): H264, 2688x1520, 20 FPS, CBR, 2880Kb/s, I frame interval 40 Extra stream (detection): H264, 1280x720, 15 FPS, CBR 1024Kb/s, I frame interval 30

Only difference is that audio recording is active for the camera with the issue but I also tried commenting out the output_args section in the config.

Version

0.11.0-3846a13

Frigate config file

{
  "birdseye": {
    "enabled": false,
    "height": 720,
    "mode": "objects",
    "quality": 8,
    "width": 1280
  },
  "cameras": {
    "garage": {
      "best_image_timeout": 60,
      "birdseye": {
        "enabled": false,
        "mode": "objects"
      },
      "detect": {
        "enabled": true,
        "fps": 5,
        "height": 720,
        "max_disappeared": 50,
        "stationary": {
          "interval": 0,
          "max_frames": {
            "default": null,
            "objects": {}
          },
          "threshold": 50
        },
        "width": 1280
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": [
          "-hwaccel",
          "vaapi",
          "-hwaccel_device",
          "/dev/dri/renderD128"
        ],
        "input_args": "-avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1",
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://****:****@192.168.1.243:554/cam/realmonitor?channel=1&subtype=2",
            "roles": [
              "detect"
            ]
          },
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://****:****@192.168.1.243:554/cam/realmonitor?channel=1&subtype=0",
            "roles": [
              "record"
            ]
          }
        ],
        "output_args": {
          "detect": [
            "-f",
            "rawvideo",
            "-pix_fmt",
            "yuv420p"
          ],
          "record": [
            "-f",
            "segment",
            "-segment_time",
            "10",
            "-segment_format",
            "mp4",
            "-reset_timestamps",
            "1",
            "-strftime",
            "1",
            "-c",
            "copy",
            "-an"
          ],
          "rtmp": [
            "-c",
            "copy",
            "-f",
            "flv"
          ]
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://****:****@192.168.1.243:554/cam/realmonitor?channel=1&subtype=2 -r 5 -s 1280x720 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "detect"
          ]
        },
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://****:****@192.168.1.243: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/garage-%Y%m%d%H%M%S.mp4",
          "roles": [
            "record"
          ]
        }
      ],
      "live": {
        "height": 720,
        "quality": 8
      },
      "motion": {
        "contour_area": 30,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 50,
        "improve_contrast": false,
        "mask": [
          "237,257,227,0,458,0,444,245",
          "1189,720,1280,720,1280,720,1255,720,1259,680,1189,685"
        ],
        "mqtt_off_delay": 30,
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "garage",
      "objects": {
        "filters": {
          "cat": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "dog": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "person": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person",
          "dog",
          "cat"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 90,
            "mode": "active_objects",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 30,
          "mode": "motion"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": false
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [],
        "retain": {
          "default": 10,
          "mode": "motion",
          "objects": {}
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "ui": {
        "dashboard": true,
        "order": 0
      },
      "zones": {}
    },
    "haustuer": {
      "best_image_timeout": 60,
      "birdseye": {
        "enabled": false,
        "mode": "objects"
      },
      "detect": {
        "enabled": true,
        "fps": 5,
        "height": 720,
        "max_disappeared": 50,
        "stationary": {
          "interval": 0,
          "max_frames": {
            "default": null,
            "objects": {}
          },
          "threshold": 50
        },
        "width": 1280
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": [
          "-hwaccel",
          "vaapi",
          "-hwaccel_device",
          "/dev/dri/renderD128"
        ],
        "input_args": "-avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1",
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://****:****@192.168.1.244:554/cam/realmonitor?channel=1&subtype=2",
            "roles": [
              "detect"
            ]
          },
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://****:****@192.168.1.244:554/cam/realmonitor?channel=1&subtype=0",
            "roles": [
              "record"
            ]
          }
        ],
        "output_args": {
          "detect": [
            "-f",
            "rawvideo",
            "-pix_fmt",
            "yuv420p"
          ],
          "record": "-f segment -segment_time 10 -strftime 1 -reset_timestamps 1 -c:v copy -c:a copy",
          "rtmp": [
            "-c",
            "copy",
            "-f",
            "flv"
          ]
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://****:****@192.168.1.244:554/cam/realmonitor?channel=1&subtype=2 -r 5 -s 1280x720 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "detect"
          ]
        },
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://****:****@192.168.1.244:554/cam/realmonitor?channel=1&subtype=0 -f segment -segment_time 10 -strftime 1 -reset_timestamps 1 -c:v copy -c:a copy /tmp/cache/haustuer-%Y%m%d%H%M%S.mp4",
          "roles": [
            "record"
          ]
        }
      ],
      "live": {
        "height": 720,
        "quality": 8
      },
      "motion": {
        "contour_area": 30,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 50,
        "improve_contrast": false,
        "mask": [
          "823,488,855,384,946,282,1117,291,1077,504,888,565",
          "1163,691,1243,687,1243,662,1162,658"
        ],
        "mqtt_off_delay": 30,
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "haustuer",
      "objects": {
        "filters": {
          "car": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "cat": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "dog": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "person": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person",
          "dog",
          "cat",
          "car"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 90,
            "mode": "active_objects",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 30,
          "mode": "motion"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": false
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [],
        "retain": {
          "default": 10,
          "mode": "motion",
          "objects": {}
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "ui": {
        "dashboard": true,
        "order": 0
      },
      "zones": {}
    }
  },
  "database": {
    "path": "/media/frigate/frigate.db"
  },
  "detect": {
    "enabled": true,
    "fps": 5,
    "height": 720,
    "max_disappeared": 50,
    "stationary": {
      "interval": 0,
      "max_frames": {
        "default": null,
        "objects": {}
      },
      "threshold": null
    },
    "width": 1280
  },
  "detectors": {
    "cpu1": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    }
  },
  "environment_vars": {},
  "ffmpeg": {
    "global_args": [
      "-hide_banner",
      "-loglevel",
      "warning"
    ],
    "hwaccel_args": [
      "-hwaccel",
      "vaapi",
      "-hwaccel_device",
      "/dev/dri/renderD128"
    ],
    "input_args": "-avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1",
    "output_args": {
      "detect": [
        "-f",
        "rawvideo",
        "-pix_fmt",
        "yuv420p"
      ],
      "record": [
        "-f",
        "segment",
        "-segment_time",
        "10",
        "-segment_format",
        "mp4",
        "-reset_timestamps",
        "1",
        "-strftime",
        "1",
        "-c",
        "copy",
        "-an"
      ],
      "rtmp": [
        "-c",
        "copy",
        "-f",
        "flv"
      ]
    }
  },
  "live": {
    "height": 720,
    "quality": 8
  },
  "logger": {
    "default": "info",
    "logs": {}
  },
  "model": {
    "height": 320,
    "labelmap": {},
    "labelmap_path": null,
    "path": null,
    "width": 320
  },
  "motion": {
    "contour_area": 30,
    "delta_alpha": 0.2,
    "frame_alpha": 0.2,
    "frame_height": 50,
    "improve_contrast": false,
    "mask": [
      "237,257,227,0,458,0,444,245"
    ],
    "mqtt_off_delay": 30,
    "threshold": 25
  },
  "mqtt": {
    "client_id": "frigate",
    "host": "192.168.0.242",
    "password": "YhI2w5w1tXlI1sYvp8z0",
    "port": 1887,
    "stats_interval": 60,
    "tls_ca_certs": null,
    "tls_client_cert": null,
    "tls_client_key": null,
    "tls_insecure": null,
    "topic_prefix": "frigate",
    "user": "system"
  },
  "objects": {
    "filters": null,
    "mask": "",
    "track": [
      "person"
    ]
  },
  "plus": {
    "enabled": false
  },
  "record": {
    "enabled": true,
    "events": {
      "objects": null,
      "post_capture": 5,
      "pre_capture": 5,
      "required_zones": [],
      "retain": {
        "default": 90,
        "mode": "active_objects",
        "objects": {}
      }
    },
    "expire_interval": 60,
    "retain": {
      "days": 30,
      "mode": "motion"
    },
    "retain_days": null
  },
  "rtmp": {
    "enabled": false
  },
  "snapshots": {
    "bounding_box": true,
    "clean_copy": true,
    "crop": false,
    "enabled": true,
    "height": null,
    "quality": 70,
    "required_zones": [],
    "retain": {
      "default": 10,
      "mode": "motion",
      "objects": {}
    },
    "timestamp": false
  },
  "timestamp_style": {
    "color": {
      "blue": 255,
      "green": 255,
      "red": 255
    },
    "effect": null,
    "format": "%m/%d/%Y %H:%M:%S",
    "position": "tl",
    "thickness": 2
  },
  "ui": {
    "use_experimental": false
  }
}

Relevant log output

Nothing special printed out while recording or playback

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://****:****@192.168.1.244:554/cam/realmonitor?channel=1&subtype=0':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 0.064000, bitrate: N/A
  Stream #0:0: Video: h264 (Main), yuv420p(progressive), 2688x1520, 20 fps, 25 tbr, 90k tbn
  Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp

Frigate stats

{"detection_fps":0.0,"detectors":{"cpu1":{"detection_start":0.0,"inference_speed":58.3,"pid":232}},"garage":{"camera_fps":5.1,"capture_pid":242,"detection_fps":0.0,"pid":238,"process_fps":5.1,"skipped_fps":0.0},"haustuer":{"camera_fps":5.0,"capture_pid":248,"detection_fps":0.0,"pid":240,"process_fps":5.0,"skipped_fps":0.0},"service":{"latest_version":"unknown","storage":{"/dev/shm":{"free":130.4,"mount_type":"tmpfs","total":134.2,"used":3.8},"/media/frigate/clips":{"free":504583.5,"mount_type":"ext4","total":974456.0,"used":420297.4},"/media/frigate/recordings":{"free":504583.5,"mount_type":"ext4","total":974456.0,"used":420297.4},"/tmp/cache":{"free":980.0,"mount_type":"tmpfs","total":1000.0,"used":20.0}},"temperatures":{},"uptime":1026,"version":"0.11.0-3846a13"}}

Operating system

Debian

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

Lupus LE228

Any other information that may be helpful

GPU acceleration on Ryzen 5600G seems to be working fine with docker. Here's my docker-compose.yml

version: "3"
networks:
  vlan110:
    driver: ipvlan
    driver_opts:
      parent: enp3s0.110
    ipam:
      config:
        - subnet: 192.168.1.0/24
services:
    frigate:
        privileged: true # this may not be necessary for all setups
        restart: unless-stopped
        image: blakeblackshear/frigate:stable
        shm_size: "128mb" # update for your cameras based on calculation above
        devices:
          - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
        volumes:
          - /etc/localtime:/etc/localtime:ro
          - frigate_config:/config:ro
          - frigate_media:/media/frigate
          - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
            target: /tmp/cache
            tmpfs:
              size: 1000000000
        ports:
          - "5000:5000"
        networks:
          vlan110:
            ipv4_address: 192.168.1.242
        environment:
          LIBVA_DRIVER_NAME: "radeonsi"

volumes:
    frigate_config:
    frigate_media:
NickM-27 commented 2 years ago

For the event that you're trying to download, if you go into the recordings directory and find the time you're expecting the recordings for, what do you see?

jokakilla commented 2 years ago

The matching video (beside some others recorded on the same hour) is there. After downloading from the system playback with VLC is working fine.

In this case: root@615152ce9765:/opt/frigate# ls -lah /media/frigate/recordings/2022-09/27/19/haustuer/50.13.mp4 -rw-r--r-- 1 root root 3.4M Sep 27 19:50 /media/frigate/recordings/2022-09/27/19/haustuer/50.13.mp4

NickM-27 commented 2 years ago

You'll likely need to watch your system usage or perhaps enable frigate.http debug logs to see why its having issues. Also we typically recommend and iframe interval the same as the frame rate, so might be worth changing that and seeing if it helps.

jokakilla commented 2 years ago

I've set the iframe interval to the framerate and added this to the config:

logger:
  # Optional: default log level (default: shown below)
  default: debug
  # Optional: module by module log level configuration
  logs:
    frigate.http: debug

But after selecting an event there was only some database logging :(

[2022-09-27 22:12:48] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:13:13] frigate.record                 DEBUG   : End expire files (legacy).
[2022-09-27 22:13:19] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."label", "t1"."zones", "t1"."start_time", "t1"."end_time", "t1"."has_clip", "t1"."has_snapshot", "t1"."plus_id", "t1"."retain_indefinitely", "t1"."sub_label", "t1"."top_score" FROM "event" AS "t1" WHERE ("t1"."camera" = ?) ORDER BY "t1"."start_time" DESC LIMIT ?', ['haustuer', '25'])
[2022-09-27 22:13:20] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
NickM-27 commented 2 years ago

But what happened? Did it still take a while? Does it a while after the last database call is made?

jokakilla commented 2 years ago

After simply clicking on an event this was visible. 503 service unavailable could be observed. Frigate log is below. image image2

[2022-09-27 22:10:02] urllib3.connectionpool         DEBUG   : Starting new HTTPS connection (1): api.github.com:443
[2022-09-27 22:12:48] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:13:13] frigate.record                 DEBUG   : End expire files (legacy).
[2022-09-27 22:13:19] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."label", "t1"."zones", "t1"."start_time", "t1"."end_time", "t1"."has_clip", "t1"."has_snapshot", "t1"."plus_id", "t1"."retain_indefinitely", "t1"."sub_label", "t1"."top_score" FROM "event" AS "t1" WHERE ("t1"."camera" = ?) ORDER BY "t1"."start_time" DESC LIMIT ?', ['haustuer', '25'])
[2022-09-27 22:13:20] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:13:22] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664308641.56554-d1wqcd', 1, 0])
[2022-09-27 22:18:52] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."label", "t1"."zones", "t1"."start_time", "t1"."end_time", "t1"."has_clip", "t1"."has_snapshot", "t1"."plus_id", "t1"."retain_indefinitely", "t1"."sub_label", "t1"."top_score" FROM "event" AS "t1" WHERE ("t1"."camera" = ?) ORDER BY "t1"."start_time" DESC LIMIT ?', ['haustuer', '25'])
[2022-09-27 22:18:56] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:18:52] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664308641.56554-d1wqcd', 1, 0])
[2022-09-27 22:18:52] peewee                         DEBUG   : ('SELECT DISTINCT "t1"."sub_label" FROM "event" AS "t1"', [])
[2022-09-27 22:18:52] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:18:54] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664308641.56554-d1wqcd', 1, 0])
[2022-09-27 22:18:54] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:18:56] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664308641.56554-d1wqcd', 1, 0])

Download took 24 seconds resulting in a wrong video. Requested download url was: https://mydomain//api/events/1664308641.56554-d1wqcd/clip.mp4?download=true But firefox saves it as clip_haustuer_1664308636.56554-1664308660.56569.mp4 I guess the name is coming from the content-disposition http response header

content-disposition
    attachment; filename=clip_haustuer_1664308636.56554-1664308660.56569.mp4

When switching to snapshot this url is requested: https://mydomain//api/events/1664308641.56554-d1wqcd/snapshot.jpg

[2022-09-27 22:10:02] urllib3.connectionpool         DEBUG   : Starting new HTTPS connection (1): api.github.com:443
[2022-09-27 22:12:48] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:13:13] frigate.record                 DEBUG   : End expire files (legacy).
[2022-09-27 22:13:19] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."label", "t1"."zones", "t1"."start_time", "t1"."end_time", "t1"."has_clip", "t1"."has_snapshot", "t1"."plus_id", "t1"."retain_indefinitely", "t1"."sub_label", "t1"."top_score" FROM "event" AS "t1" WHERE ("t1"."camera" = ?) ORDER BY "t1"."start_time" DESC LIMIT ?', ['haustuer', '25'])
[2022-09-27 22:13:20] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:13:22] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664308641.56554-d1wqcd', 1, 0])
[2022-09-27 22:18:52] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."label", "t1"."zones", "t1"."start_time", "t1"."end_time", "t1"."has_clip", "t1"."has_snapshot", "t1"."plus_id", "t1"."retain_indefinitely", "t1"."sub_label", "t1"."top_score" FROM "event" AS "t1" WHERE ("t1"."camera" = ?) ORDER BY "t1"."start_time" DESC LIMIT ?', ['haustuer', '25'])
[2022-09-27 22:18:56] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:18:52] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664308641.56554-d1wqcd', 1, 0])
[2022-09-27 22:18:52] peewee                         DEBUG   : ('SELECT DISTINCT "t1"."sub_label" FROM "event" AS "t1"', [])
[2022-09-27 22:18:52] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:18:54] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664308641.56554-d1wqcd', 1, 0])
[2022-09-27 22:18:54] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:18:56] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664308641.56554-d1wqcd', 1, 0])
[2022-09-27 22:27:37] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664308641.56554-d1wqcd', 1, 0])
[2022-09-27 22:27:35] peewee                         DEBUG   : ('SELECT DISTINCT "t1"."sub_label" FROM "event" AS "t1"', [])
[2022-09-27 22:27:35] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."label", "t1"."zones", "t1"."start_time", "t1"."end_time", "t1"."has_clip", "t1"."has_snapshot", "t1"."plus_id", "t1"."retain_indefinitely", "t1"."sub_label", "t1"."top_score" FROM "event" AS "t1" WHERE ("t1"."camera" = ?) ORDER BY "t1"."start_time" DESC LIMIT ?', ['haustuer', '25'])
[2022-09-27 22:27:37] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 1664308636.56554, 1664308660.56569, 'haustuer'])
[2022-09-27 22:28:07] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."label", "t1"."zones", "t1"."start_time", "t1"."end_time", "t1"."has_clip", "t1"."has_snapshot", "t1"."plus_id", "t1"."retain_indefinitely", "t1"."sub_label", "t1"."top_score" FROM "event" AS "t1" WHERE ("t1"."camera" = ?) ORDER BY "t1"."start_time" DESC LIMIT ?', ['haustuer', '25'])
[2022-09-27 22:28:07] peewee                         DEBUG   : ('SELECT DISTINCT "t1"."sub_label" FROM "event" AS "t1"', [])

Could this be a database issue? Or something related to my nginx reverse proxy?

jokakilla commented 2 years ago

Reverse proxy config:

server {
    listen      443 ssl http2;
    server_name mydomain;
    set_real_ip_from  192.168.40.242;
    real_ip_header X-Forwarded-For;
    add_header Strict-Transport-Security "max-age=15552000;preload";
    client_max_body_size        1000M;

    if ($allowed_country = yes) {
        set $exclusions 1;
    }

    if ($exclusions = "0") {
        return 444;
    }

    location / {
      auth_basic             "Restricted";
      auth_basic_user_file   /etc/nginx/conf.d/.htpasswd;
      proxy_redirect     off;
      proxy_set_header   Host $host;
      proxy_set_header   X-Real-IP $remote_addr;
      proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header   X-Forwarded-Host $server_name;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "Upgrade";
      proxy_pass        http://192.168.1.242:5000/;
      proxy_read_timeout 90;
    }
    ssl_certificate /etc/letsencrypt/live/mydomain/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mydomain/privkey.pem;
    if ($scheme != "https") {
      return 301 https://$host$request_uri;
    }
}
jokakilla commented 2 years ago

I've downloaded the sqlite db and had a look at the mentioned event. I guess I could upload the database if it helps.

GET on https://mydomain//vod/event/1664301007.338933-w2ps5p/master.m3u8 returns 503 service unavailable. For the other camera a GET e.g. on https://mydomain//vod/event/1664346478.550336-3c11q4/master.m3u8 200 OK.

The event table entry for ID "1664301007.338933-w2ps5p" looks totally fine but I didn't really understand the relation to the recordings table yet. There is no entry with this ID.

By the way when I try to download one of the faulty clips an FFMPEG process with 100% cpu load starts. It seems to cut a piece of video from a recording when the clip is unavailable. ffmpeg -y -protocol_whitelist pipe,file -f concat -safe 0 -i /dev/stdin -c copy -movflags +faststart /tmp/cache/clip_haustuer_1664301002.338933-1664301037.748637.mp4

For clips from the other camera the download starts immediately and does not start such a FFMPEG process.

Log from the time when I selected the event and the clip could not be played back.

[2022-09-28 20:55:52] frigate.record                 DEBUG   : Checking tmp clip /tmp/cache/clip_haustuer_1664301002.338933-1664301037.748637.mp4.
[2022-09-28 20:56:52] frigate.record                 DEBUG   : Checking tmp clip /tmp/cache/clip_haustuer_1664301002.338933-1664301037.748637.mp4.
[2022-09-28 20:56:52] frigate.record                 DEBUG   : Deleting tmp clip.
[2022-09-28 20:57:02] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."label", "t1"."zones", "t1"."start_time", "t1"."end_time", "t1"."has_clip", "t1"."has_snapshot", "t1"."plus_id", "t1"."retain_indefinitely", "t1"."sub_label", "t1"."top_score" FROM "event" AS "t1" WHERE ("t1"."camera" = ?) ORDER BY "t1"."start_time" DESC LIMIT ?', ['haustuer', '25'])
[2022-09-28 20:57:06] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664301007.338933-w2ps5p', 1, 0])
[2022-09-28 20:57:06] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664301002.338933, 1664301037.748637, 1664301002.338933, 1664301037.748637, 1664301002.338933, 1664301037.748637, 'haustuer'])
[2022-09-28 21:00:23] peewee                         DEBUG   : ('SELECT DISTINCT "t1"."sub_label" FROM "event" AS "t1"', [])
[2022-09-28 21:00:33] peewee                         DEBUG   : ('SELECT DISTINCT "t1"."sub_label" FROM "event" AS "t1"', [])
[2022-09-28 21:00:38] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."label", "t1"."zones", "t1"."start_time", "t1"."end_time", "t1"."has_clip", "t1"."has_snapshot", "t1"."plus_id", "t1"."retain_indefinitely", "t1"."sub_label", "t1"."top_score" FROM "event" AS "t1" WHERE ("t1"."camera" = ?) ORDER BY "t1"."start_time" DESC LIMIT ?', ['haustuer', '25'])
[2022-09-28 21:00:38] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664301007.338933-w2ps5p', 1, 0])
[2022-09-28 21:14:07] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."label", "t1"."zones", "t1"."start_time", "t1"."end_time", "t1"."has_clip", "t1"."has_snapshot", "t1"."plus_id", "t1"."retain_indefinitely", "t1"."sub_label", "t1"."top_score" FROM "event" AS "t1" WHERE ("t1"."camera" = ?) ORDER BY "t1"."start_time" DESC LIMIT ?', ['haustuer', '25'])
[2022-09-28 21:14:07] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664301007.338933-w2ps5p', 1, 0])
[2022-09-28 21:14:07] peewee                         DEBUG   : ('SELECT DISTINCT "t1"."sub_label" FROM "event" AS "t1"', [])
[2022-09-28 21:14:07] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664301002.338933, 1664301037.748637, 1664301002.338933, 1664301037.748637, 1664301002.338933, 1664301037.748637, 'haustuer'])
[2022-09-28 21:14:08] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664301007.338933-w2ps5p', 1, 0])
[2022-09-28 21:14:08] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664301002.338933, 1664301037.748637, 1664301002.338933, 1664301037.748637, 1664301002.338933, 1664301037.748637, 'haustuer'])
[2022-09-28 21:14:10] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664301007.338933-w2ps5p', 1, 0])
[2022-09-28 21:14:10] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664301002.338933, 1664301037.748637, 1664301002.338933, 1664301037.748637, 1664301002.338933, 1664301037.748637, 'haustuer'])

Log when selected download clip until clip downloaded (with wrong video content)


[2022-09-28 21:15:17] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."label", "t1"."zones", "t1"."start_time", "t1"."end_time", "t1"."has_clip", "t1"."has_snapshot", "t1"."plus_id", "t1"."retain_indefinitely", "t1"."sub_label", "t1"."top_score" FROM "event" AS "t1" WHERE ("t1"."camera" = ?) ORDER BY "t1"."start_time" DESC LIMIT ?', ['haustuer', '25'])
[2022-09-28 21:15:17] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1664301007.338933-w2ps5p', 1, 0])
[2022-09-28 21:15:17] peewee                         DEBUG   : ('SELECT DISTINCT "t1"."sub_label" FROM "event" AS "t1"', [])
[2022-09-28 21:15:17] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."camera", "t1"."path", "t1"."start_time", "t1"."end_time", "t1"."duration", "t1"."motion", "t1"."objects" FROM "recordings" AS "t1" WHERE (((("t1"."start_time" BETWEEN ? AND ?) OR ("t1"."end_time" BETWEEN ? AND ?)) OR (("t1"."start_time" < ?) AND ("t1"."end_time" > ?))) AND ("t1"."camera" = ?)) ORDER BY "t1"."start_time" ASC', [1664301002.338933, 1664301037.748637, 1664301002.338933, 1664301037.748637, 1664301002.338933, 1664301037.748637, 'haustuer'])
jokakilla commented 2 years ago

Btw: After deleting the datebase (made a backup before) events from this camera can be played back and downloaded just fine.

So it seems to be an issue with the database.

NickM-27 commented 2 years ago

I've seen this once before on my setup. It happened when a decent was entered that essentially lasted until 2059 or something which naturally threw everything off.

I've never had it happen again though, so not really able to reproduce to fix or know what caused it.

ehn commented 2 years ago

I'm getting the "The media could not be loaded, either because the server or network failed or because the format is not supported." error message on a black screen with a spinner a lot when trying to play back events. As in 30–50% of them. I haven't had the time to investigate it properly and file a bug report/config support issue yet, but if it's helpful, I'm happy to try to provide additional info here.

It could be due to a completely different underlying issue, of course.

NickM-27 commented 2 years ago

I'm getting the "The media could not be loaded, either because the server or network failed or because the format is not supported." error message on a black screen with a spinner a lot when trying to play back events. As in 30–50% of them. I haven't had the time to investigate it properly and file a bug report/config support issue yet, but if it's helpful, I'm happy to try to provide additional info here.

It could be due to a completely different underlying issue, of course.

Unless it's not working on one camera but working for others, it's likely something different

ehn commented 2 years ago

It's not specific to one camera. It sometimes works, sometimes not for all the cameras.

NickM-27 commented 2 years ago

It's not specific to one camera. It sometimes works, sometimes not for all the cameras.

Recommend making your own issue then

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.