Refactor Recordings (#7275)

* Run ffmpeg sub process & video_properties as async

* Run recording cleanup in the main process

* More cleanup

* Use inter process communication to write recordings into the DB

* Formatting
This commit is contained in:
Nicolas Mowen
2023-07-26 04:55:08 -06:00
committed by GitHub
parent 9016a48dc7
commit 761daf46ea
7 changed files with 61 additions and 34 deletions

View File

@@ -1,5 +1,6 @@
from __future__ import annotations
import asyncio
import json
import logging
import os
@@ -1059,7 +1060,7 @@ class FrigateConfig(FrigateBaseModel):
if "detect" in input.roles:
stream_info = {"width": 0, "height": 0}
try:
stream_info = get_video_properties(input.path)
stream_info = asyncio.run(get_video_properties(input.path))
except Exception:
logger.warn(
f"Error detecting stream resolution automatically for {input.path} Applying default values."