mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Use const for location
This commit is contained in:
parent
74a6e51f59
commit
0f11939bea
@ -1,6 +1,7 @@
|
|||||||
BASE_DIR = "/media/frigate"
|
BASE_DIR = "/media/frigate"
|
||||||
CLIPS_DIR = f"{BASE_DIR}/clips"
|
CLIPS_DIR = f"{BASE_DIR}/clips"
|
||||||
RECORD_DIR = f"{BASE_DIR}/recordings"
|
RECORD_DIR = f"{BASE_DIR}/recordings"
|
||||||
|
BIRDSEYE_PIPE = "/tmp/cache/birdseye"
|
||||||
CACHE_DIR = "/tmp/cache"
|
CACHE_DIR = "/tmp/cache"
|
||||||
YAML_EXT = (".yaml", ".yml")
|
YAML_EXT = (".yaml", ".yml")
|
||||||
PLUS_ENV_VAR = "PLUS_API_KEY"
|
PLUS_ENV_VAR = "PLUS_API_KEY"
|
||||||
|
|||||||
@ -22,7 +22,7 @@ from ws4py.server.wsgiutils import WebSocketWSGIApplication
|
|||||||
from ws4py.websocket import WebSocket
|
from ws4py.websocket import WebSocket
|
||||||
|
|
||||||
from frigate.config import BirdseyeModeEnum, FrigateConfig
|
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
|
from frigate.util import SharedMemoryFrameManager, copy_yuv_to_position, get_yuv_crop
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -30,8 +30,6 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
class FFMpegConverter:
|
class FFMpegConverter:
|
||||||
|
|
||||||
BIRDSEYE_PIPE = "/tmp/cache/birdseye"
|
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
in_width: int,
|
in_width: int,
|
||||||
@ -43,9 +41,9 @@ class FFMpegConverter:
|
|||||||
):
|
):
|
||||||
if birdseye_rtsp:
|
if birdseye_rtsp:
|
||||||
try:
|
try:
|
||||||
os.mkfifo(self.BIRDSEYE_PIPE, mode=0o777)
|
os.mkfifo(BIRDSEYE_PIPE, mode=0o777)
|
||||||
stdin = os.open(self.BIRDSEYE_PIPE, os.O_RDONLY | os.O_NONBLOCK)
|
stdin = os.open(BIRDSEYE_PIPE, os.O_RDONLY | os.O_NONBLOCK)
|
||||||
self.bd_pipe = os.open(self.BIRDSEYE_PIPE, os.O_WRONLY)
|
self.bd_pipe = os.open(BIRDSEYE_PIPE, os.O_WRONLY)
|
||||||
os.close(stdin)
|
os.close(stdin)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"The exception is {e}")
|
print(f"The exception is {e}")
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import requests
|
|||||||
from frigate.util import escape_special_characters
|
from frigate.util import escape_special_characters
|
||||||
|
|
||||||
from frigate.config import FrigateConfig
|
from frigate.config import FrigateConfig
|
||||||
|
from frigate.const import BIRDSEYE_PIPE
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ class RestreamApi:
|
|||||||
if self.config.restream.birdseye:
|
if self.config.restream.birdseye:
|
||||||
self.relays[
|
self.relays[
|
||||||
"birdseye"
|
"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():
|
for name, path in self.relays.items():
|
||||||
params = {"src": path, "name": name}
|
params = {"src": path, "name": name}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user