mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
add config for camera live stream
This commit is contained in:
parent
f009897eca
commit
762afb8f43
@ -240,7 +240,7 @@ timestamp_style:
|
|||||||
# Optional: Line thickness of font (default: shown below)
|
# Optional: Line thickness of font (default: shown below)
|
||||||
thickness: 2
|
thickness: 2
|
||||||
# Optional: Effect of lettering (default: shown below)
|
# Optional: Effect of lettering (default: shown below)
|
||||||
# None (No effect),
|
# None (No effect),
|
||||||
# "solid" (solid background in inverse color of font)
|
# "solid" (solid background in inverse color of font)
|
||||||
# "shadow" (shadow for font)
|
# "shadow" (shadow for font)
|
||||||
effect: None
|
effect: None
|
||||||
@ -357,9 +357,19 @@ cameras:
|
|||||||
|
|
||||||
# Optional: RTMP re-stream configuration
|
# Optional: RTMP re-stream configuration
|
||||||
rtmp:
|
rtmp:
|
||||||
# Required: Enable the live stream (default: True)
|
# Required: Enable the RTMP stream (default: True)
|
||||||
enabled: True
|
enabled: True
|
||||||
|
|
||||||
|
# Optional: Live stream configuration for WebUI
|
||||||
|
live:
|
||||||
|
# Optional: Set the height of the live stream. (default: detect stream height)
|
||||||
|
# This must be less than or equal to the height of the detect stream. Lower resolutions
|
||||||
|
# reduce bandwidth required for viewing the live stream. Width is computed to match known aspect ratio.
|
||||||
|
height: 720
|
||||||
|
# Optional: Set the encode quality of the live stream (default: shown below)
|
||||||
|
# 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
|
||||||
|
quality: 8
|
||||||
|
|
||||||
# Optional: Configuration for the jpg snapshots written to the clips directory for each event
|
# Optional: Configuration for the jpg snapshots written to the clips directory for each event
|
||||||
snapshots:
|
snapshots:
|
||||||
# Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
|
# Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
|
||||||
@ -430,16 +440,16 @@ cameras:
|
|||||||
format: "%m/%d/%Y %H:%M:%S"
|
format: "%m/%d/%Y %H:%M:%S"
|
||||||
# Optional: Color of font
|
# Optional: Color of font
|
||||||
color:
|
color:
|
||||||
# All Required when color is specified (default: shown below)
|
# All Required when color is specified (default: shown below)
|
||||||
red: 255
|
red: 255
|
||||||
green: 255
|
green: 255
|
||||||
blue: 255
|
blue: 255
|
||||||
# Optional: Scale factor for font (default: shown below)
|
# Optional: Scale factor for font (default: shown below)
|
||||||
scale: 1.0
|
scale: 1.0
|
||||||
# Optional: Line thickness of font (default: shown below)
|
# Optional: Line thickness of font (default: shown below)
|
||||||
thickness: 2
|
thickness: 2
|
||||||
# Optional: Effect of lettering (default: shown below)
|
# Optional: Effect of lettering (default: shown below)
|
||||||
# None (No effect),
|
# None (No effect),
|
||||||
# "solid" (solid background in inverse color of font)
|
# "solid" (solid background in inverse color of font)
|
||||||
# "shadow" (shadow for font)
|
# "shadow" (shadow for font)
|
||||||
effect: None
|
effect: None
|
||||||
|
@ -167,14 +167,14 @@ A dynamic combined camera view of all tracked cameras. This is optimized for min
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
birdseye:
|
birdseye:
|
||||||
# Optional: Enable birdseye view
|
# Optional: Enable birdseye view (default: shown below)
|
||||||
enabled: True
|
enabled: True
|
||||||
# Optional: Width of the output resolution
|
# Optional: Width of the output resolution (default: shown below)
|
||||||
width: 1280
|
width: 1280
|
||||||
# Optional: Height of the output resolution
|
# Optional: Height of the output resolution (default: shown below)
|
||||||
height: 720
|
height: 720
|
||||||
# Optional: Encoding quality of the mpeg1 feed. 1 is the highest quality, and 31 is the lowest.
|
# Optional: Encoding quality of the mpeg1 feed (default: shown below)
|
||||||
# Lower quality feeds utilize less CPU resources.
|
# 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
|
||||||
quality: 8
|
quality: 8
|
||||||
# Optional: Mode of the view. Available options are: objects, motion, and continuous
|
# Optional: Mode of the view. Available options are: objects, motion, and continuous
|
||||||
# objects - cameras are included if they have had a tracked object within the last 30 seconds
|
# objects - cameras are included if they have had a tracked object within the last 30 seconds
|
||||||
|
@ -649,6 +649,10 @@ CAMERAS_SCHEMA = vol.Schema(
|
|||||||
vol.Optional("rtmp", default={}): {
|
vol.Optional("rtmp", default={}): {
|
||||||
vol.Required("enabled", default=True): bool,
|
vol.Required("enabled", default=True): bool,
|
||||||
},
|
},
|
||||||
|
vol.Optional("live", default={}): {
|
||||||
|
"height": int,
|
||||||
|
vol.Optional("quality", default=8): vol.Range(min=1, max=31),
|
||||||
|
},
|
||||||
vol.Optional("snapshots", default={}): {
|
vol.Optional("snapshots", default={}): {
|
||||||
vol.Optional("enabled", default=False): bool,
|
vol.Optional("enabled", default=False): bool,
|
||||||
vol.Optional("clean_copy", default=True): bool,
|
vol.Optional("clean_copy", default=True): bool,
|
||||||
@ -827,6 +831,27 @@ class CameraRtmpConfig:
|
|||||||
return dataclasses.asdict(self)
|
return dataclasses.asdict(self)
|
||||||
|
|
||||||
|
|
||||||
|
@dataclasses.dataclass
|
||||||
|
class CameraLiveConfig:
|
||||||
|
height: int
|
||||||
|
width: int
|
||||||
|
quality: int
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def build(cls, config, camera_height, camera_width) -> CameraRtmpConfig:
|
||||||
|
if "height" in config and config["height"] <= camera_height:
|
||||||
|
height = config["height"]
|
||||||
|
width = int(height * (camera_width / camera_height))
|
||||||
|
else:
|
||||||
|
height = camera_height
|
||||||
|
width = camera_width
|
||||||
|
|
||||||
|
return CameraLiveConfig(height, width, config["quality"])
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
return dataclasses.asdict(self)
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(frozen=True)
|
@dataclasses.dataclass(frozen=True)
|
||||||
class CameraConfig:
|
class CameraConfig:
|
||||||
name: str
|
name: str
|
||||||
@ -839,6 +864,7 @@ class CameraConfig:
|
|||||||
clips: CameraClipsConfig
|
clips: CameraClipsConfig
|
||||||
record: RecordConfig
|
record: RecordConfig
|
||||||
rtmp: CameraRtmpConfig
|
rtmp: CameraRtmpConfig
|
||||||
|
live: CameraLiveConfig
|
||||||
snapshots: CameraSnapshotsConfig
|
snapshots: CameraSnapshotsConfig
|
||||||
mqtt: CameraMqttConfig
|
mqtt: CameraMqttConfig
|
||||||
objects: ObjectConfig
|
objects: ObjectConfig
|
||||||
@ -886,6 +912,9 @@ class CameraConfig:
|
|||||||
clips=CameraClipsConfig.build(config["clips"], global_config),
|
clips=CameraClipsConfig.build(config["clips"], global_config),
|
||||||
record=RecordConfig.build(config["record"], global_config["record"]),
|
record=RecordConfig.build(config["record"], global_config["record"]),
|
||||||
rtmp=CameraRtmpConfig.build(config["rtmp"]),
|
rtmp=CameraRtmpConfig.build(config["rtmp"]),
|
||||||
|
live=CameraLiveConfig.build(
|
||||||
|
config["live"], config["height"], config["width"]
|
||||||
|
),
|
||||||
snapshots=CameraSnapshotsConfig.build(config["snapshots"], global_config),
|
snapshots=CameraSnapshotsConfig.build(config["snapshots"], global_config),
|
||||||
mqtt=CameraMqttConfig.build(config["mqtt"]),
|
mqtt=CameraMqttConfig.build(config["mqtt"]),
|
||||||
objects=ObjectConfig.build(
|
objects=ObjectConfig.build(
|
||||||
|
@ -346,9 +346,9 @@ def output_frames(config: FrigateConfig, video_output_queue):
|
|||||||
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],
|
||||||
cam_config.frame_shape[1],
|
cam_config.live.width,
|
||||||
cam_config.frame_shape[0],
|
cam_config.live.height,
|
||||||
8,
|
cam_config.live.quality,
|
||||||
)
|
)
|
||||||
broadcasters[camera] = BroadcastThread(
|
broadcasters[camera] = BroadcastThread(
|
||||||
camera, converters[camera], websocket_server
|
camera, converters[camera], websocket_server
|
||||||
|
Loading…
Reference in New Issue
Block a user