mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-04 02:05:21 +03:00
remove restream from frigate logic
This commit is contained in:
parent
1ef109e171
commit
c5dd20ae67
@ -28,7 +28,6 @@ from frigate.object_processing import TrackedObjectProcessor
|
|||||||
from frigate.output import output_frames
|
from frigate.output import output_frames
|
||||||
from frigate.plus import PlusApi
|
from frigate.plus import PlusApi
|
||||||
from frigate.record import RecordingCleanup, RecordingMaintainer
|
from frigate.record import RecordingCleanup, RecordingMaintainer
|
||||||
from frigate.restream import RestreamApi
|
|
||||||
from frigate.stats import StatsEmitter, stats_init
|
from frigate.stats import StatsEmitter, stats_init
|
||||||
from frigate.storage import StorageMaintainer
|
from frigate.storage import StorageMaintainer
|
||||||
from frigate.version import VERSION
|
from frigate.version import VERSION
|
||||||
@ -173,10 +172,6 @@ class FrigateApp:
|
|||||||
self.plus_api,
|
self.plus_api,
|
||||||
)
|
)
|
||||||
|
|
||||||
def init_restream(self) -> None:
|
|
||||||
self.restream = RestreamApi(self.config)
|
|
||||||
self.restream.add_cameras()
|
|
||||||
|
|
||||||
def init_dispatcher(self) -> None:
|
def init_dispatcher(self) -> None:
|
||||||
comms: list[Communicator] = []
|
comms: list[Communicator] = []
|
||||||
|
|
||||||
@ -381,7 +376,6 @@ class FrigateApp:
|
|||||||
print(e)
|
print(e)
|
||||||
self.log_process.terminate()
|
self.log_process.terminate()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
self.init_restream()
|
|
||||||
self.start_detectors()
|
self.start_detectors()
|
||||||
self.start_video_output_processor()
|
self.start_video_output_processor()
|
||||||
self.start_detected_frames_processor()
|
self.start_detected_frames_processor()
|
||||||
|
|||||||
@ -1,33 +0,0 @@
|
|||||||
"""Controls go2rtc restream."""
|
|
||||||
|
|
||||||
|
|
||||||
import logging
|
|
||||||
import requests
|
|
||||||
|
|
||||||
from frigate.config import FrigateConfig
|
|
||||||
from frigate.const import BIRDSEYE_PIPE
|
|
||||||
from frigate.ffmpeg_presets import (
|
|
||||||
parse_preset_hardware_acceleration_encode,
|
|
||||||
)
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class RestreamApi:
|
|
||||||
"""Control go2rtc relay API."""
|
|
||||||
|
|
||||||
def __init__(self, config: FrigateConfig) -> None:
|
|
||||||
self.config: FrigateConfig = config
|
|
||||||
|
|
||||||
def add_cameras(self) -> None:
|
|
||||||
"""Add cameras to go2rtc."""
|
|
||||||
self.relays: dict[str, str] = {}
|
|
||||||
|
|
||||||
if self.config.birdseye.restream:
|
|
||||||
self.relays[
|
|
||||||
"birdseye"
|
|
||||||
] = f"exec:{parse_preset_hardware_acceleration_encode(self.config.ffmpeg.hwaccel_args, f'-f rawvideo -pix_fmt yuv420p -video_size {self.config.birdseye.width}x{self.config.birdseye.height} -r 10 -i {BIRDSEYE_PIPE}', '-rtsp_transport tcp -f rtsp {output}')}"
|
|
||||||
|
|
||||||
for name, path in self.relays.items():
|
|
||||||
params = {"src": path, "name": name}
|
|
||||||
requests.put("http://127.0.0.1:1984/api/streams", params=params)
|
|
||||||
Loading…
Reference in New Issue
Block a user