don't modify ffmpeg_cmd object

This commit is contained in:
Blake Blackshear 2021-11-08 19:05:39 -06:00
parent b29b311e92
commit 273076e7f4
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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"])