mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 17:55:21 +03:00
Put old live config back and fix birdseye references
This commit is contained in:
parent
4ff1a9216f
commit
162c7c9d3b
@ -519,9 +519,9 @@ class RtmpConfig(FrigateBaseModel):
|
|||||||
enabled: bool = Field(default=False, title="RTMP restreaming enabled.")
|
enabled: bool = Field(default=False, title="RTMP restreaming enabled.")
|
||||||
|
|
||||||
|
|
||||||
class JsmpegStreamConfig(FrigateBaseModel):
|
class CameraLiveConfig(FrigateBaseModel):
|
||||||
height: int = Field(default=720, title="Live camera view height.")
|
height: int = Field(default=720, title="Live camera view height")
|
||||||
quality: int = Field(default=8, ge=1, le=31, title="Live camera view quality.")
|
quality: int = Field(default=8, ge=1, le=31, title="Live camera view quality")
|
||||||
|
|
||||||
|
|
||||||
class RestreamConfig(BaseModel):
|
class RestreamConfig(BaseModel):
|
||||||
@ -553,6 +553,9 @@ class CameraConfig(FrigateBaseModel):
|
|||||||
rtmp: RtmpConfig = Field(
|
rtmp: RtmpConfig = Field(
|
||||||
default_factory=RtmpConfig, title="RTMP restreaming configuration."
|
default_factory=RtmpConfig, title="RTMP restreaming configuration."
|
||||||
)
|
)
|
||||||
|
live: CameraLiveConfig = Field(
|
||||||
|
default_factory=CameraLiveConfig, title="Live playback settings."
|
||||||
|
)
|
||||||
snapshots: SnapshotsConfig = Field(
|
snapshots: SnapshotsConfig = Field(
|
||||||
default_factory=SnapshotsConfig, title="Snapshot configuration."
|
default_factory=SnapshotsConfig, title="Snapshot configuration."
|
||||||
)
|
)
|
||||||
|
|||||||
@ -415,15 +415,15 @@ def output_frames(config: FrigateConfig, video_output_queue):
|
|||||||
|
|
||||||
for camera, cam_config in config.cameras.items():
|
for camera, cam_config in config.cameras.items():
|
||||||
width = int(
|
width = int(
|
||||||
cam_config.restream.jsmpeg.height
|
cam_config.live.height
|
||||||
* (cam_config.frame_shape[1] / cam_config.frame_shape[0])
|
* (cam_config.frame_shape[1] / cam_config.frame_shape[0])
|
||||||
)
|
)
|
||||||
converters[camera] = FFMpegConverter(
|
converters[camera] = FFMpegConverter(
|
||||||
cam_config.frame_shape[1],
|
cam_config.frame_shape[1],
|
||||||
cam_config.frame_shape[0],
|
cam_config.frame_shape[0],
|
||||||
width,
|
width,
|
||||||
cam_config.restream.jsmpeg.height,
|
cam_config.live.height,
|
||||||
cam_config.restream.jsmpeg.quality,
|
cam_config.live.quality,
|
||||||
)
|
)
|
||||||
broadcasters[camera] = BroadcastThread(
|
broadcasters[camera] = BroadcastThread(
|
||||||
camera, converters[camera], websocket_server
|
camera, converters[camera], websocket_server
|
||||||
@ -436,7 +436,7 @@ def output_frames(config: FrigateConfig, video_output_queue):
|
|||||||
config.birdseye.width,
|
config.birdseye.width,
|
||||||
config.birdseye.height,
|
config.birdseye.height,
|
||||||
config.birdseye.quality,
|
config.birdseye.quality,
|
||||||
config.restream.birdseye,
|
config.birdseye.restream,
|
||||||
)
|
)
|
||||||
broadcasters["birdseye"] = BroadcastThread(
|
broadcasters["birdseye"] = BroadcastThread(
|
||||||
"birdseye", converters["birdseye"], websocket_server
|
"birdseye", converters["birdseye"], websocket_server
|
||||||
@ -449,7 +449,7 @@ def output_frames(config: FrigateConfig, video_output_queue):
|
|||||||
|
|
||||||
birdseye_manager = BirdsEyeFrameManager(config, frame_manager)
|
birdseye_manager = BirdsEyeFrameManager(config, frame_manager)
|
||||||
|
|
||||||
if config.restream.birdseye:
|
if config.birdseye.restream:
|
||||||
birdseye_buffer = frame_manager.create(
|
birdseye_buffer = frame_manager.create(
|
||||||
"birdseye",
|
"birdseye",
|
||||||
birdseye_manager.yuv_shape[0] * birdseye_manager.yuv_shape[1],
|
birdseye_manager.yuv_shape[0] * birdseye_manager.yuv_shape[1],
|
||||||
@ -479,7 +479,7 @@ def output_frames(config: FrigateConfig, video_output_queue):
|
|||||||
converters[camera].write(frame.tobytes())
|
converters[camera].write(frame.tobytes())
|
||||||
|
|
||||||
if config.birdseye.enabled and (
|
if config.birdseye.enabled and (
|
||||||
config.restream.birdseye
|
config.birdseye.restream
|
||||||
or any(
|
or any(
|
||||||
ws.environ["PATH_INFO"].endswith("birdseye")
|
ws.environ["PATH_INFO"].endswith("birdseye")
|
||||||
for ws in websocket_server.manager
|
for ws in websocket_server.manager
|
||||||
@ -494,7 +494,7 @@ def output_frames(config: FrigateConfig, video_output_queue):
|
|||||||
):
|
):
|
||||||
frame_bytes = birdseye_manager.frame.tobytes()
|
frame_bytes = birdseye_manager.frame.tobytes()
|
||||||
|
|
||||||
if config.restream.birdseye:
|
if config.birdseye.restream:
|
||||||
birdseye_buffer[:] = frame_bytes
|
birdseye_buffer[:] = frame_bytes
|
||||||
|
|
||||||
converters["birdseye"].write(frame_bytes)
|
converters["birdseye"].write(frame_bytes)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user