From 273076e7f4b758b555133aeb619831250dec56bc Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Mon, 8 Nov 2021 19:05:39 -0600 Subject: [PATCH] don't modify ffmpeg_cmd object --- frigate/config.py | 2 +- frigate/http.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frigate/config.py b/frigate/config.py index aee716a84..0ed749d72 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -518,7 +518,7 @@ class CameraConfig(FrigateBaseModel): def ffmpeg_cmds(self) -> List[Dict[str, List[str]]]: return self._ffmpeg_cmds - def create_ffmpeg_cmds(self) -> List[Dict[str, List[str]]]: + def create_ffmpeg_cmds(self): ffmpeg_cmds = [] for ffmpeg_input in self.ffmpeg.inputs: ffmpeg_cmd = self._get_ffmpeg_cmd(ffmpeg_input) diff --git a/frigate/http.py b/frigate/http.py index 32dcdb130..69c06c41d 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -1,6 +1,7 @@ import base64 from collections import OrderedDict from datetime import datetime, timedelta +import copy import json import glob import logging @@ -321,7 +322,7 @@ def config(): # add in the ffmpeg_cmds for camera_name, camera in current_app.frigate_config.cameras.items(): camera_dict = config["cameras"][camera_name] - camera_dict["ffmpeg_cmds"] = camera.ffmpeg_cmds + camera_dict["ffmpeg_cmds"] = copy.deepcopy(camera.ffmpeg_cmds) for cmd in camera_dict["ffmpeg_cmds"]: cmd["cmd"] = " ".join(cmd["cmd"])