frigate: 0.15.2 -> 0.16.0

https://github.com/blakeblackshear/frigate/releases/tag/v0.16.0

+115 -393
+30 -2
nixos/modules/services/video/frigate.nix
··· 103 103 # Send a subrequest to verify if the user is authenticated and has permission to access the resource. 104 104 auth_request /auth; 105 105 106 - # Save the upstream metadata response headers from Authelia to variables. 106 + # Save the upstream metadata response headers from the auth request to variables 107 107 auth_request_set $user $upstream_http_remote_user; 108 + auth_request_set $role $upstream_http_remote_role; 108 109 auth_request_set $groups $upstream_http_remote_groups; 109 110 auth_request_set $name $upstream_http_remote_name; 110 111 auth_request_set $email $upstream_http_remote_email; 111 112 112 113 # Inject the metadata response headers from the variables into the request made to the backend. 113 114 proxy_set_header Remote-User $user; 115 + proxy_set_header Remote-Role $role; 114 116 proxy_set_header Remote-Groups $groups; 115 117 proxy_set_header Remote-Email $email; 116 118 proxy_set_header Remote-Name $name; ··· 343 345 expires off; 344 346 345 347 keepalive_disable safari; 348 + 349 + # vod module returns 502 for non-existent media 350 + # https://github.com/kaltura/nginx-vod-module/issues/468 351 + error_page 502 =404 /vod-not-found; 346 352 ''; 353 + }; 354 + "/vod-not-found" = { 355 + return = 404; 347 356 }; 348 357 "/stream/" = { 349 358 alias = "/var/cache/frigate/stream/"; ··· 549 558 add_header Cache-Control "public"; 550 559 ''; 551 560 }; 561 + "/locales/" = { 562 + root = cfg.package.web; 563 + extraConfig = '' 564 + access_log off; 565 + add_header Cache-Control "public"; 566 + ''; 567 + }; 568 + "~ ^/.*-([A-Za-z0-9]+)\.webmanifest$" = { 569 + root = cfg.package.web; 570 + extraConfig = '' 571 + access_log off; 572 + expires 1y; 573 + add_header Cache-Control "public"; 574 + default_type application/json; 575 + proxy_set_header Accept-Encoding ""; 576 + ''; 577 + }; 552 578 "/" = { 553 579 root = cfg.package.web; 554 580 tryFiles = "$uri $uri.html $uri/ /index.html"; ··· 582 608 open_file_cache_min_uses 1; 583 609 open_file_cache_errors on; 584 610 aio on; 611 + 612 + # file upload size 613 + client_max_body_size 20M; 585 614 586 615 # https://github.com/kaltura/nginx-vod-module#vod_open_file_thread_pool 587 616 vod_open_file_thread_pool default; ··· 657 686 [ 658 687 # unfree: 659 688 # config.boot.kernelPackages.nvidiaPackages.latest.bin 660 - ffmpeg-headless 661 689 libva-utils 662 690 procps 663 691 radeontop
+7 -365
pkgs/by-name/fr/frigate/constants.patch
··· 1 - diff --git a/frigate/api/media.py b/frigate/api/media.py 2 - index b5f3ba70..09a09c13 100644 3 - --- a/frigate/api/media.py 4 - +++ b/frigate/api/media.py 5 - @@ -31,6 +31,7 @@ from frigate.config import FrigateConfig 6 - from frigate.const import ( 7 - CACHE_DIR, 8 - CLIPS_DIR, 9 - + INSTALL_DIR, 10 - MAX_SEGMENT_DURATION, 11 - PREVIEW_FRAME_TYPE, 12 - RECORD_DIR, 13 - @@ -154,7 +155,9 @@ def latest_frame( 14 - frame_processor.get_current_frame_time(camera_name) + retry_interval 15 - ): 16 - if request.app.camera_error_image is None: 17 - - error_image = glob.glob("/opt/frigate/frigate/images/camera-error.jpg") 18 - + error_image = glob.glob( 19 - + os.path.join(INSTALL_DIR, "frigate/images/camera-error.jpg") 20 - + ) 21 - 22 - if len(error_image) > 0: 23 - request.app.camera_error_image = cv2.imread( 24 - @@ -497,7 +500,7 @@ def recording_clip( 25 - ) 26 - 27 - file_name = sanitize_filename(f"playlist_{camera_name}_{start_ts}-{end_ts}.txt") 28 - - file_path = f"/tmp/cache/{file_name}" 29 - + file_path = os.path.join(CACHE_DIR, file_name) 30 - with open(file_path, "w") as file: 31 - clip: Recordings 32 - for clip in recordings: 33 - diff --git a/frigate/api/preview.py b/frigate/api/preview.py 34 - index d14a15ff..2db2326a 100644 35 - --- a/frigate/api/preview.py 36 - +++ b/frigate/api/preview.py 37 - @@ -9,7 +9,7 @@ from fastapi import APIRouter 38 - from fastapi.responses import JSONResponse 39 - 40 - from frigate.api.defs.tags import Tags 41 - -from frigate.const import CACHE_DIR, PREVIEW_FRAME_TYPE 42 - +from frigate.const import BASE_DIR, CACHE_DIR, PREVIEW_FRAME_TYPE 43 - from frigate.models import Previews 44 - 45 - logger = logging.getLogger(__name__) 46 - @@ -52,7 +52,7 @@ def preview_ts(camera_name: str, start_ts: float, end_ts: float): 47 - clips.append( 48 - { 49 - "camera": preview["camera"], 50 - - "src": preview["path"].replace("/media/frigate", ""), 51 - + "src": preview["path"].replace(BASE_DIR, ""), 52 - "type": "video/mp4", 53 - "start": preview["start_time"], 54 - "end": preview["end_time"], 55 1 diff --git a/frigate/comms/webpush.py b/frigate/comms/webpush.py 56 - index abfd52d1..ab4cf3c5 100644 2 + index c5986d45..b767e19e 100644 57 3 --- a/frigate/comms/webpush.py 58 4 +++ b/frigate/comms/webpush.py 59 - @@ -12,7 +12,7 @@ from pywebpush import WebPusher 5 + @@ -17,7 +17,7 @@ from titlecase import titlecase 6 + from frigate.comms.base_communicator import Communicator 60 7 from frigate.comms.config_updater import ConfigSubscriber 61 - from frigate.comms.dispatcher import Communicator 62 8 from frigate.config import FrigateConfig 63 9 -from frigate.const import CONFIG_DIR 64 10 +from frigate.const import BASE_DIR, CONFIG_DIR 65 11 from frigate.models import User 66 12 67 13 logger = logging.getLogger(__name__) 68 - @@ -151,7 +151,7 @@ class WebPushClient(Communicator): # type: ignore[misc] 69 - camera: str = payload["after"]["camera"] 70 - title = f"{', '.join(sorted_objects).replace('_', ' ').title()}{' was' if state == 'end' else ''} detected in {', '.join(payload['after']['data']['zones']).replace('_', ' ').title()}" 71 - message = f"Detected on {camera.replace('_', ' ').title()}" 14 + @@ -333,7 +333,7 @@ class WebPushClient(Communicator): # type: ignore[misc] 15 + 16 + title = f"{titlecase(', '.join(sorted_objects).replace('_', ' '))}{' was' if state == 'end' else ''} detected in {titlecase(', '.join(payload['after']['data']['zones']).replace('_', ' '))}" 17 + message = f"Detected on {titlecase(camera.replace('_', ' '))}" 72 18 - image = f"{payload['after']['thumb_path'].replace('/media/frigate', '')}" 73 19 + image = f"{payload['after']['thumb_path'].replace(BASE_DIR, '')}" 74 20 75 21 # if event is ongoing open to live view otherwise open to recordings view 76 22 direct_url = f"/review?id={reviewId}" if state == "end" else f"/#{camera}" 77 - diff --git a/frigate/const.py b/frigate/const.py 78 - index 5976f47b..dc710467 100644 79 - --- a/frigate/const.py 80 - +++ b/frigate/const.py 81 - @@ -1,5 +1,6 @@ 82 - import re 83 - 84 - +INSTALL_DIR = "/opt/frigate" 85 - CONFIG_DIR = "/config" 86 - DEFAULT_DB_PATH = f"{CONFIG_DIR}/frigate.db" 87 - MODEL_CACHE_DIR = f"{CONFIG_DIR}/model_cache" 88 - diff --git a/frigate/detectors/detector_config.py b/frigate/detectors/detector_config.py 89 - index 452f1fee..13535a62 100644 90 - --- a/frigate/detectors/detector_config.py 91 - +++ b/frigate/detectors/detector_config.py 92 - @@ -9,7 +9,7 @@ import requests 93 - from pydantic import BaseModel, ConfigDict, Field 94 - from pydantic.fields import PrivateAttr 95 - 96 - -from frigate.const import DEFAULT_ATTRIBUTE_LABEL_MAP 97 - +from frigate.const import DEFAULT_ATTRIBUTE_LABEL_MAP, MODEL_CACHE_DIR 98 - from frigate.plus import PlusApi 99 - from frigate.util.builtin import generate_color_palette, load_labels 100 - 101 - @@ -117,7 +117,7 @@ class ModelConfig(BaseModel): 102 - return 103 - 104 - model_id = self.path[7:] 105 - - self.path = f"/config/model_cache/{model_id}" 106 - + self.path = os.path.join(MODEL_CACHE_DIR, model_id) 107 - model_info_path = f"{self.path}.json" 108 - 109 - # download the model if it doesn't exist 110 - diff --git a/frigate/detectors/plugins/hailo8l.py b/frigate/detectors/plugins/hailo8l.py 111 - index b66d78bd..69e86bc5 100644 112 - --- a/frigate/detectors/plugins/hailo8l.py 113 - +++ b/frigate/detectors/plugins/hailo8l.py 114 - @@ -22,6 +22,7 @@ except ModuleNotFoundError: 115 - from pydantic import BaseModel, Field 116 - from typing_extensions import Literal 117 - 118 - +from frigate.const import MODEL_CACHE_DIR 119 - from frigate.detectors.detection_api import DetectionApi 120 - from frigate.detectors.detector_config import BaseDetectorConfig 121 - 122 - @@ -57,7 +58,7 @@ class HailoDetector(DetectionApi): 123 - self.h8l_tensor_format = detector_config.model.input_tensor 124 - self.h8l_pixel_format = detector_config.model.input_pixel_format 125 - self.model_url = "https://hailo-model-zoo.s3.eu-west-2.amazonaws.com/ModelZoo/Compiled/v2.11.0/hailo8l/ssd_mobilenet_v1.hef" 126 - - self.cache_dir = "/config/model_cache/h8l_cache" 127 - + self.cache_dir = os.path.join(MODEL_CACHE_DIR, "h8l_cache") 128 - self.expected_model_filename = "ssd_mobilenet_v1.hef" 129 - output_type = "FLOAT32" 130 - 131 - diff --git a/frigate/detectors/plugins/openvino.py b/frigate/detectors/plugins/openvino.py 132 - index 51e48530..d199317b 100644 133 - --- a/frigate/detectors/plugins/openvino.py 134 - +++ b/frigate/detectors/plugins/openvino.py 135 - @@ -7,6 +7,7 @@ import openvino.properties as props 136 - from pydantic import Field 137 - from typing_extensions import Literal 138 - 139 - +from frigate.const import MODEL_CACHE_DIR 140 - from frigate.detectors.detection_api import DetectionApi 141 - from frigate.detectors.detector_config import BaseDetectorConfig, ModelTypeEnum 142 - 143 - @@ -35,8 +36,10 @@ class OvDetector(DetectionApi): 144 - logger.error(f"OpenVino model file {detector_config.model.path} not found.") 145 - raise FileNotFoundError 146 - 147 - - os.makedirs("/config/model_cache/openvino", exist_ok=True) 148 - - self.ov_core.set_property({props.cache_dir: "/config/model_cache/openvino"}) 149 - + os.makedirs(os.path.join(MODEL_CACHE_DIR, "openvino"), exist_ok=True) 150 - + self.ov_core.set_property( 151 - + {props.cache_dir: os.path.join(MODEL_CACHE_DIR, "openvino")} 152 - + ) 153 - self.interpreter = self.ov_core.compile_model( 154 - model=detector_config.model.path, device_name=detector_config.device 155 - ) 156 - diff --git a/frigate/detectors/plugins/rknn.py b/frigate/detectors/plugins/rknn.py 157 - index df94d7b6..bc3d9ae0 100644 158 - --- a/frigate/detectors/plugins/rknn.py 159 - +++ b/frigate/detectors/plugins/rknn.py 160 - @@ -6,6 +6,7 @@ from typing import Literal 161 - 162 - from pydantic import Field 163 - 164 - +from frigate.const import MODEL_CACHE_DIR 165 - from frigate.detectors.detection_api import DetectionApi 166 - from frigate.detectors.detector_config import BaseDetectorConfig, ModelTypeEnum 167 - 168 - @@ -17,7 +18,7 @@ supported_socs = ["rk3562", "rk3566", "rk3568", "rk3576", "rk3588"] 169 - 170 - supported_models = {ModelTypeEnum.yolonas: "^deci-fp16-yolonas_[sml]$"} 171 - 172 - -model_cache_dir = "/config/model_cache/rknn_cache/" 173 - +model_cache_dir = os.path.join(MODEL_CACHE_DIR, "rknn_cache/") 174 - 175 - 176 - class RknnDetectorConfig(BaseDetectorConfig): 177 - diff --git a/frigate/detectors/plugins/rocm.py b/frigate/detectors/plugins/rocm.py 178 - index 60118d12..7c87edb5 100644 179 - --- a/frigate/detectors/plugins/rocm.py 180 - +++ b/frigate/detectors/plugins/rocm.py 181 - @@ -9,6 +9,7 @@ import numpy as np 182 - from pydantic import Field 183 - from typing_extensions import Literal 184 - 185 - +from frigate.const import MODEL_CACHE_DIR 186 - from frigate.detectors.detection_api import DetectionApi 187 - from frigate.detectors.detector_config import ( 188 - BaseDetectorConfig, 189 - @@ -116,7 +117,7 @@ class ROCmDetector(DetectionApi): 190 - 191 - logger.info(f"AMD/ROCm: saving parsed model into {mxr_path}") 192 - 193 - - os.makedirs("/config/model_cache/rocm", exist_ok=True) 194 - + os.makedirs(os.path.join(MODEL_CACHE_DIR, "rocm"), exist_ok=True) 195 - migraphx.save(self.model, mxr_path) 196 - 197 - logger.info("AMD/ROCm: model loaded") 198 - diff --git a/frigate/output/birdseye.py b/frigate/output/birdseye.py 199 - index 00f17c8f..8331eb64 100644 200 - --- a/frigate/output/birdseye.py 201 - +++ b/frigate/output/birdseye.py 202 - @@ -16,7 +16,7 @@ import numpy as np 203 - 204 - from frigate.comms.config_updater import ConfigSubscriber 205 - from frigate.config import BirdseyeModeEnum, FfmpegConfig, FrigateConfig 206 - -from frigate.const import BASE_DIR, BIRDSEYE_PIPE 207 - +from frigate.const import BASE_DIR, BIRDSEYE_PIPE, INSTALL_DIR 208 - from frigate.util.image import ( 209 - SharedMemoryFrameManager, 210 - copy_yuv_to_position, 211 - @@ -297,7 +297,9 @@ class BirdsEyeFrameManager: 212 - birdseye_logo = cv2.imread(custom_logo_files[0], cv2.IMREAD_UNCHANGED) 213 - 214 - if birdseye_logo is None: 215 - - logo_files = glob.glob("/opt/frigate/frigate/images/birdseye.png") 216 - + logo_files = glob.glob( 217 - + os.path.join(INSTALL_DIR, "frigate/images/birdseye.png") 218 - + ) 219 - 220 - if len(logo_files) > 0: 221 - birdseye_logo = cv2.imread(logo_files[0], cv2.IMREAD_UNCHANGED) 222 - diff --git a/frigate/test/http_api/base_http_test.py b/frigate/test/http_api/base_http_test.py 223 - index e7a1d03e..4fa4a5b5 100644 224 - --- a/frigate/test/http_api/base_http_test.py 225 - +++ b/frigate/test/http_api/base_http_test.py 226 - @@ -9,6 +9,7 @@ from playhouse.sqliteq import SqliteQueueDatabase 227 - 228 - from frigate.api.fastapi_app import create_fastapi_app 229 - from frigate.config import FrigateConfig 230 - +from frigate.const import BASE_DIR, CACHE_DIR 231 - from frigate.models import Event, Recordings, ReviewSegment 232 - from frigate.review.types import SeverityEnum 233 - from frigate.test.const import TEST_DB, TEST_DB_CLEANUPS 234 - @@ -72,19 +73,19 @@ class BaseTestHttp(unittest.TestCase): 235 - "total": 67.1, 236 - "used": 16.6, 237 - }, 238 - - "/media/frigate/clips": { 239 - + os.path.join(BASE_DIR, "clips"): { 240 - "free": 42429.9, 241 - "mount_type": "ext4", 242 - "total": 244529.7, 243 - "used": 189607.0, 244 - }, 245 - - "/media/frigate/recordings": { 246 - + os.path.join(BASE_DIR, "recordings"): { 247 - "free": 0.2, 248 - "mount_type": "ext4", 249 - "total": 8.0, 250 - "used": 7.8, 251 - }, 252 - - "/tmp/cache": { 253 - + CACHE_DIR: { 254 - "free": 976.8, 255 - "mount_type": "tmpfs", 256 - "total": 1000.0, 257 - diff --git a/frigate/test/test_config.py b/frigate/test/test_config.py 258 - index e6cb1274..5a3deefd 100644 259 - --- a/frigate/test/test_config.py 260 - +++ b/frigate/test/test_config.py 261 - @@ -854,9 +854,9 @@ class TestConfig(unittest.TestCase): 262 - assert frigate_config.model.merged_labelmap[0] == "person" 263 - 264 - def test_plus_labelmap(self): 265 - - with open("/config/model_cache/test", "w") as f: 266 - + with open(os.path.join(MODEL_CACHE_DIR, "test"), "w") as f: 267 - json.dump(self.plus_model_info, f) 268 - - with open("/config/model_cache/test.json", "w") as f: 269 - + with open(os.path.join(MODEL_CACHE_DIR, "test.json"), "w") as f: 270 - json.dump(self.plus_model_info, f) 271 - 272 - config = { 273 - diff --git a/frigate/test/test_http.py b/frigate/test/test_http.py 274 - index 21379425..66f9d22a 100644 275 - --- a/frigate/test/test_http.py 276 - +++ b/frigate/test/test_http.py 277 - @@ -12,6 +12,7 @@ from playhouse.sqliteq import SqliteQueueDatabase 278 - 279 - from frigate.api.fastapi_app import create_fastapi_app 280 - from frigate.config import FrigateConfig 281 - +from frigate.const import BASE_DIR, CACHE_DIR 282 - from frigate.models import Event, Recordings, Timeline 283 - from frigate.stats.emitter import StatsEmitter 284 - from frigate.test.const import TEST_DB, TEST_DB_CLEANUPS 285 - @@ -76,19 +77,19 @@ class TestHttp(unittest.TestCase): 286 - "total": 67.1, 287 - "used": 16.6, 288 - }, 289 - - "/media/frigate/clips": { 290 - + os.path.join(BASE_DIR, "clips"): { 291 - "free": 42429.9, 292 - "mount_type": "ext4", 293 - "total": 244529.7, 294 - "used": 189607.0, 295 - }, 296 - - "/media/frigate/recordings": { 297 - + os.path.join(BASE_DIR, "recordings"): { 298 - "free": 0.2, 299 - "mount_type": "ext4", 300 - "total": 8.0, 301 - "used": 7.8, 302 - }, 303 - - "/tmp/cache": { 304 - + CACHE_DIR: { 305 - "free": 976.8, 306 - "mount_type": "tmpfs", 307 - "total": 1000.0, 308 - diff --git a/frigate/util/config.py b/frigate/util/config.py 309 - index d456c755..b6b270c9 100644 310 - --- a/frigate/util/config.py 311 - +++ b/frigate/util/config.py 312 - @@ -14,7 +14,7 @@ from frigate.util.services import get_video_properties 313 - logger = logging.getLogger(__name__) 314 - 315 - CURRENT_CONFIG_VERSION = "0.15-1" 316 - -DEFAULT_CONFIG_FILE = "/config/config.yml" 317 - +DEFAULT_CONFIG_FILE = os.path.join(CONFIG_DIR, "config.yml") 318 - 319 - 320 - def find_config_file() -> str: 321 - diff --git a/frigate/util/model.py b/frigate/util/model.py 322 - index ce2c9538..6e93cb38 100644 323 - --- a/frigate/util/model.py 324 - +++ b/frigate/util/model.py 325 - @@ -12,6 +12,8 @@ except ImportError: 326 - # openvino is not included 327 - pass 328 - 329 - +from frigate.const import MODEL_CACHE_DIR 330 - + 331 - logger = logging.getLogger(__name__) 332 - 333 - 334 - @@ -46,7 +48,8 @@ def get_ort_providers( 335 - # so it is not enabled by default 336 - if device == "Tensorrt": 337 - os.makedirs( 338 - - "/config/model_cache/tensorrt/ort/trt-engines", exist_ok=True 339 - + os.path.join(MODEL_CACHE_DIR, "tensorrt/ort/trt-engines"), 340 - + exist_ok=True, 341 - ) 342 - device_id = 0 if not device.isdigit() else int(device) 343 - providers.append(provider) 344 - @@ -57,19 +60,23 @@ def get_ort_providers( 345 - and os.environ.get("USE_FP_16", "True") != "False", 346 - "trt_timing_cache_enable": True, 347 - "trt_engine_cache_enable": True, 348 - - "trt_timing_cache_path": "/config/model_cache/tensorrt/ort", 349 - - "trt_engine_cache_path": "/config/model_cache/tensorrt/ort/trt-engines", 350 - + "trt_timing_cache_path": os.path.join( 351 - + MODEL_CACHE_DIR, "tensorrt/ort" 352 - + ), 353 - + "trt_engine_cache_path": os.path.join( 354 - + MODEL_CACHE_DIR, "tensorrt/ort/trt-engines" 355 - + ), 356 - } 357 - ) 358 - else: 359 - continue 360 - elif provider == "OpenVINOExecutionProvider": 361 - - os.makedirs("/config/model_cache/openvino/ort", exist_ok=True) 362 - + os.makedirs(os.path.join(MODEL_CACHE_DIR, "openvino/ort"), exist_ok=True) 363 - providers.append(provider) 364 - options.append( 365 - { 366 - "arena_extend_strategy": "kSameAsRequested", 367 - - "cache_dir": "/config/model_cache/openvino/ort", 368 - + "cache_dir": os.path.join(MODEL_CACHE_DIR, "openvino/ort"), 369 - "device_type": device, 370 - } 371 - ) 372 - @@ -103,7 +110,7 @@ class ONNXModelRunner: 373 - self.type = "ov" 374 - self.ov = ov.Core() 375 - self.ov.set_property( 376 - - {ov.properties.cache_dir: "/config/model_cache/openvino"} 377 - + {ov.properties.cache_dir: os.path.join(MODEL_CACHE_DIR, "openvino")} 378 - ) 379 - self.interpreter = self.ov.compile_model( 380 - model=model_path, device_name=device
+39
pkgs/by-name/fr/frigate/ffmpeg.patch
··· 1 + diff --git a/frigate/config/camera/ffmpeg.py b/frigate/config/camera/ffmpeg.py 2 + index 04bbfac7..4390a571 100644 3 + --- a/frigate/config/camera/ffmpeg.py 4 + +++ b/frigate/config/camera/ffmpeg.py 5 + @@ -70,18 +70,14 @@ class FfmpegConfig(FrigateBaseModel): 6 + @property 7 + def ffmpeg_path(self) -> str: 8 + if self.path == "default": 9 + - return f"/usr/lib/ffmpeg/{DEFAULT_FFMPEG_VERSION}/bin/ffmpeg" 10 + - elif self.path in INCLUDED_FFMPEG_VERSIONS: 11 + - return f"/usr/lib/ffmpeg/{self.path}/bin/ffmpeg" 12 + + return "@ffmpeg@" 13 + else: 14 + return f"{self.path}/bin/ffmpeg" 15 + 16 + @property 17 + def ffprobe_path(self) -> str: 18 + if self.path == "default": 19 + - return f"/usr/lib/ffmpeg/{DEFAULT_FFMPEG_VERSION}/bin/ffprobe" 20 + - elif self.path in INCLUDED_FFMPEG_VERSIONS: 21 + - return f"/usr/lib/ffmpeg/{self.path}/bin/ffprobe" 22 + + return "@ffprobe@" 23 + else: 24 + return f"{self.path}/bin/ffprobe" 25 + 26 + diff --git a/frigate/record/export.py b/frigate/record/export.py 27 + index 0d3f96da..09cadbcd 100644 28 + --- a/frigate/record/export.py 29 + +++ b/frigate/record/export.py 30 + @@ -126,7 +126,7 @@ class RecordingExporter(threading.Thread): 31 + minutes = int(diff / 60) 32 + seconds = int(diff % 60) 33 + ffmpeg_cmd = [ 34 + - "/usr/lib/ffmpeg/7.0/bin/ffmpeg", # hardcode path for exports thumbnail due to missing libwebp support 35 + + "@ffmpeg@", # hardcode path for exports thumbnail due to missing libwebp support 36 + "-hide_banner", 37 + "-loglevel", 38 + "warning", 39 + ~
+38 -25
pkgs/by-name/fr/frigate/package.nix
··· 2 2 lib, 3 3 stdenv, 4 4 callPackage, 5 - python312, 5 + replaceVars, 6 + python312Packages, 6 7 fetchFromGitHub, 7 8 fetchurl, 8 - rocmPackages, 9 + ffmpeg-headless, 9 10 sqlite-vec, 10 11 frigate, 11 12 nixosTests, 12 13 }: 13 14 14 15 let 15 - version = "0.15.2"; 16 + version = "0.16.0"; 16 17 17 18 src = fetchFromGitHub { 18 19 name = "frigate-${version}-source"; 19 20 owner = "blakeblackshear"; 20 21 repo = "frigate"; 21 22 tag = "v${version}"; 22 - hash = "sha256-YJFtMVCTtp8h9a9RmkcoZSQ+nIKb5o/4JVynVslkx78="; 23 + hash = "sha256-O1rOFRrS3hDbf4fVgfz+KASo20R1aqbDoIf3JKQ1jhs="; 23 24 }; 24 25 25 26 frigate-web = callPackage ./web.nix { 26 27 inherit version src; 27 28 }; 28 29 29 - python = python312; 30 + python = python312Packages.python; 30 31 31 32 # Tensorflow audio model 32 33 # https://github.com/blakeblackshear/frigate/blob/v0.15.0/docker/main/Dockerfile#L125 ··· 55 56 hash = "sha256-5Cj2vEiWR8Z9d2xBmVoLZuNRv4UOuxHSGZQWTJorXUQ="; 56 57 }; 57 58 in 58 - python.pkgs.buildPythonApplication rec { 59 + python312Packages.buildPythonApplication rec { 59 60 pname = "frigate"; 60 61 inherit version; 61 62 format = "other"; 62 63 63 64 inherit src; 64 65 65 - patches = [ ./constants.patch ]; 66 + patches = [ 67 + ./constants.patch 68 + 69 + (replaceVars ./ffmpeg.patch { 70 + ffmpeg = lib.getExe ffmpeg-headless; 71 + ffprobe = lib.getExe' ffmpeg-headless "ffprobe"; 72 + }) 73 + ]; 66 74 67 75 postPatch = '' 68 76 echo 'VERSION = "${version}"' > frigate/version.py ··· 86 94 substituteInPlace frigate/db/sqlitevecq.py \ 87 95 --replace-fail "/usr/local/lib/vec0" "${lib.getLib sqlite-vec}/lib/vec0${stdenv.hostPlatform.extensions.sharedLibrary}" 88 96 89 - '' 90 - # clang-rocm, provided by `rocmPackages.clr`, only works on x86_64-linux specifically 91 - + lib.optionalString (with stdenv.hostPlatform; isx86_64 && isLinux) '' 92 - substituteInPlace frigate/detectors/plugins/rocm.py \ 93 - --replace-fail "/opt/rocm/bin/rocminfo" "rocminfo" \ 94 - --replace-fail "/opt/rocm/lib" "${rocmPackages.clr}/lib" 95 - 96 - '' 97 - + '' 98 97 # provide default paths for models and maps that are shipped with frigate 99 98 substituteInPlace frigate/config/config.py \ 100 99 --replace-fail "/cpu_model.tflite" "${tflite_cpu_model}" \ ··· 106 105 substituteInPlace frigate/events/audio.py \ 107 106 --replace-fail "/cpu_audio_model.tflite" "${placeholder "out"}/share/frigate/cpu_audio_model.tflite" \ 108 107 --replace-fail "/audio-labelmap.txt" "${placeholder "out"}/share/frigate/audio-labelmap.txt" 109 - 110 - # work around onvif-zeep idiosyncrasy 111 - substituteInPlace frigate/ptz/onvif.py \ 112 - --replace-fail dist-packages site-packages 113 108 ''; 114 109 115 110 dontBuild = true; 116 111 117 - dependencies = with python.pkgs; [ 112 + dependencies = with python312Packages; [ 118 113 # docker/main/requirements.txt 119 114 scikit-build 120 115 # docker/main/requirements-wheel.txt 116 + aiofiles 121 117 aiohttp 118 + appdirs 119 + argcomplete 120 + contextlib2 122 121 click 122 + distlib 123 123 fastapi 124 + filelock 125 + future 126 + importlib-metadata 127 + importlib-resources 124 128 google-generativeai 125 - imutils 126 129 joserfc 130 + levenshtein 127 131 markupsafe 132 + netaddr 133 + netifaces 128 134 norfair 129 135 numpy 130 136 ollama 131 137 onnxruntime 132 - onvif-zeep 138 + onvif-zeep-async 133 139 openai 134 140 opencv4 135 141 openvino ··· 138 144 pathvalidate 139 145 peewee 140 146 peewee-migrate 147 + prometheus-client 141 148 psutil 142 149 py3nvml 150 + pyclipper 143 151 pydantic 152 + python-multipart 144 153 pytz 145 154 py-vapid 146 155 pywebpush ··· 149 158 ruamel-yaml 150 159 scipy 151 160 setproctitle 161 + shapely 152 162 slowapi 153 163 starlette 154 164 starlette-context 155 165 tensorflow-bin 166 + titlecase 156 167 transformers 157 168 tzlocal 158 169 unidecode 159 170 uvicorn 171 + verboselogs 172 + virtualenv 160 173 ws4py 161 174 ]; 162 175 ··· 178 191 runHook postInstall 179 192 ''; 180 193 181 - nativeCheckInputs = with python.pkgs; [ 194 + nativeCheckInputs = with python312Packages; [ 182 195 pytestCheckHook 183 196 ]; 184 197 ··· 200 213 passthru = { 201 214 web = frigate-web; 202 215 inherit python; 203 - pythonPath = (python.pkgs.makePythonPath dependencies) + ":${frigate}/${python.sitePackages}"; 216 + pythonPath = (python312Packages.makePythonPath dependencies) + ":${frigate}/${python.sitePackages}"; 204 217 tests = { 205 218 inherit (nixosTests) frigate; 206 219 };
+1 -1
pkgs/by-name/fr/frigate/web.nix
··· 30 30 --replace-fail "/tmp/cache" "/var/cache/frigate" 31 31 ''; 32 32 33 - npmDepsHash = "sha256-tPwydUJtFDJs17q0haJaUVEkxua+nHfmwQ9Z9Y24ca8="; 33 + npmDepsHash = "sha256-CrK/6BaKmKIxlohEZdGEEKJkioszBUupyKQx4nBeLqI="; 34 34 35 35 installPhase = '' 36 36 cp -rv dist/ $out