Use const for location

This commit is contained in:
Nick Mowen 2022-12-29 14:31:13 -07:00
parent 74a6e51f59
commit 0f11939bea
3 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,7 @@
BASE_DIR = "/media/frigate"
CLIPS_DIR = f"{BASE_DIR}/clips"
RECORD_DIR = f"{BASE_DIR}/recordings"
BIRDSEYE_PIPE = "/tmp/cache/birdseye"
CACHE_DIR = "/tmp/cache"
YAML_EXT = (".yaml", ".yml")
PLUS_ENV_VAR = "PLUS_API_KEY"

View File

@ -22,7 +22,7 @@ from ws4py.server.wsgiutils import WebSocketWSGIApplication
from ws4py.websocket import WebSocket
from frigate.config import BirdseyeModeEnum, FrigateConfig
from frigate.const import BASE_DIR
from frigate.const import BASE_DIR, BIRDSEYE_PIPE
from frigate.util import SharedMemoryFrameManager, copy_yuv_to_position, get_yuv_crop
logger = logging.getLogger(__name__)
@ -30,8 +30,6 @@ logger = logging.getLogger(__name__)
class FFMpegConverter:
BIRDSEYE_PIPE = "/tmp/cache/birdseye"
def __init__(
self,
in_width: int,
@ -43,9 +41,9 @@ class FFMpegConverter:
):
if birdseye_rtsp:
try:
os.mkfifo(self.BIRDSEYE_PIPE, mode=0o777)
stdin = os.open(self.BIRDSEYE_PIPE, os.O_RDONLY | os.O_NONBLOCK)
self.bd_pipe = os.open(self.BIRDSEYE_PIPE, os.O_WRONLY)
os.mkfifo(BIRDSEYE_PIPE, mode=0o777)
stdin = os.open(BIRDSEYE_PIPE, os.O_RDONLY | os.O_NONBLOCK)
self.bd_pipe = os.open(BIRDSEYE_PIPE, os.O_WRONLY)
os.close(stdin)
except Exception as e:
print(f"The exception is {e}")

View File

@ -6,6 +6,7 @@ import requests
from frigate.util import escape_special_characters
from frigate.config import FrigateConfig
from frigate.const import BIRDSEYE_PIPE
logger = logging.getLogger(__name__)
@ -45,7 +46,7 @@ class RestreamApi:
if self.config.restream.birdseye:
self.relays[
"birdseye"
] = f"exec:ffmpeg -hide_banner -f rawvideo -pix_fmt yuv420p -s {self.config.birdseye.width}x{self.config.birdseye.height} -i /tmp/birdseye -tune zerolatency -preset ultrafast -c:v libx264 -rtsp_transport tcp -f rtsp {{output}}"
] = f"exec:ffmpeg -hide_banner -f rawvideo -pix_fmt yuv420p -s {self.config.birdseye.width}x{self.config.birdseye.height} -i {BIRDSEYE_PIPE} -tune zerolatency -preset ultrafast -c:v libx264 -rtsp_transport tcp -f rtsp {{output}}"
for name, path in self.relays.items():
params = {"src": path, "name": name}