mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-04 13:47:37 +02:00
Use presets by default (#4597)
This commit is contained in:
parent
420bcd7aa0
commit
9b99ba81e5
@ -3,6 +3,12 @@ id: camera_specific
|
|||||||
title: Camera Specific Configurations
|
title: Camera Specific Configurations
|
||||||
---
|
---
|
||||||
|
|
||||||
|
:::note
|
||||||
|
|
||||||
|
This page makes use of presets of FFmpeg args. For more information on presets, see the [FFmpeg Presets](/configuration/ffmpeg_presets) page.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
## MJPEG Cameras
|
## MJPEG Cameras
|
||||||
|
|
||||||
The input and output parameters need to be adjusted for MJPEG cameras
|
The input and output parameters need to be adjusted for MJPEG cameras
|
||||||
@ -50,6 +56,7 @@ ffmpeg:
|
|||||||
## Model/vendor specific setup
|
## Model/vendor specific setup
|
||||||
|
|
||||||
### Annke C800
|
### Annke C800
|
||||||
|
|
||||||
This camera is H.265 only. To be able to play clips on some devices (like MacOs or iPhone) the H.265 stream has to be repackaged and the audio stream has to be converted to aac. Unfortunately direct playback of in the browser is not working (yet), but the downloaded clip can be played locally.
|
This camera is H.265 only. To be able to play clips on some devices (like MacOs or iPhone) the H.265 stream has to be repackaged and the audio stream has to be converted to aac. Unfortunately direct playback of in the browser is not working (yet), but the downloaded clip can be played locally.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@ -69,10 +76,8 @@ cameras:
|
|||||||
rtmp:
|
rtmp:
|
||||||
enabled: False # <-- RTMP should be disabled if your stream is not H264
|
enabled: False # <-- RTMP should be disabled if your stream is not H264
|
||||||
detect:
|
detect:
|
||||||
width: # <---- update for your camera's resolution
|
width: # <---- update for your camera's resolution
|
||||||
height: # <---- update for your camera's resolution
|
height: # <---- update for your camera's resolution
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Blue Iris RTSP Cameras
|
### Blue Iris RTSP Cameras
|
||||||
|
10
docs/docs/configuration/ffmpeg_presets.md
Normal file
10
docs/docs/configuration/ffmpeg_presets.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
id: ffmpeg_presets
|
||||||
|
title: FFmpeg presets
|
||||||
|
---
|
||||||
|
|
||||||
|
Some presets of FFmpeg args are provided by default to make the configuration easier. All presets can be seen in [this file](https://github.com/blakeblackshear/frigate/blob/master/frigate/ffmpeg_presets.py).
|
||||||
|
|
||||||
|
<!--
|
||||||
|
TODO: Use [markdown-magic](https://github.com/DavidWells/markdown-magic) to generate this list from the source code.
|
||||||
|
-->
|
@ -138,6 +138,7 @@ birdseye:
|
|||||||
mode: objects
|
mode: objects
|
||||||
|
|
||||||
# Optional: ffmpeg configuration
|
# Optional: ffmpeg configuration
|
||||||
|
# More information about presets at https://docs.frigate.video/configuration/ffmpeg_presets
|
||||||
ffmpeg:
|
ffmpeg:
|
||||||
# Optional: global ffmpeg args (default: shown below)
|
# Optional: global ffmpeg args (default: shown below)
|
||||||
global_args: -hide_banner -loglevel warning
|
global_args: -hide_banner -loglevel warning
|
||||||
@ -145,15 +146,15 @@ ffmpeg:
|
|||||||
# NOTE: See hardware acceleration docs for your specific device
|
# NOTE: See hardware acceleration docs for your specific device
|
||||||
hwaccel_args: []
|
hwaccel_args: []
|
||||||
# Optional: global input args (default: shown below)
|
# Optional: global input args (default: shown below)
|
||||||
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1
|
input_args: preset-rtsp-generic
|
||||||
# Optional: global output args
|
# Optional: global output args
|
||||||
output_args:
|
output_args:
|
||||||
# Optional: output args for detect streams (default: shown below)
|
# Optional: output args for detect streams (default: shown below)
|
||||||
detect: -f rawvideo -pix_fmt yuv420p
|
detect: -f rawvideo -pix_fmt yuv420p
|
||||||
# Optional: output args for record streams (default: shown below)
|
# Optional: output args for record streams (default: shown below)
|
||||||
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
|
record: preset-record-generic
|
||||||
# Optional: output args for rtmp streams (default: shown below)
|
# Optional: output args for rtmp streams (default: shown below)
|
||||||
rtmp: -c copy -f flv
|
rtmp: preset-rtmp-generic
|
||||||
|
|
||||||
# Optional: Detect configuration
|
# Optional: Detect configuration
|
||||||
# NOTE: Can be overridden at the camera level
|
# NOTE: Can be overridden at the camera level
|
||||||
|
@ -25,6 +25,7 @@ module.exports = {
|
|||||||
"configuration/advanced",
|
"configuration/advanced",
|
||||||
"configuration/hardware_acceleration",
|
"configuration/hardware_acceleration",
|
||||||
"configuration/camera_specific",
|
"configuration/camera_specific",
|
||||||
|
"configuration/ffmpeg_presets",
|
||||||
],
|
],
|
||||||
Integrations: [
|
Integrations: [
|
||||||
"integrations/home-assistant",
|
"integrations/home-assistant",
|
||||||
|
@ -355,35 +355,10 @@ class BirdseyeCameraConfig(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
FFMPEG_GLOBAL_ARGS_DEFAULT = ["-hide_banner", "-loglevel", "warning"]
|
FFMPEG_GLOBAL_ARGS_DEFAULT = ["-hide_banner", "-loglevel", "warning"]
|
||||||
FFMPEG_INPUT_ARGS_DEFAULT = [
|
FFMPEG_INPUT_ARGS_DEFAULT = "preset-rtsp-generic"
|
||||||
"-avoid_negative_ts",
|
|
||||||
"make_zero",
|
|
||||||
"-fflags",
|
|
||||||
"+genpts+discardcorrupt",
|
|
||||||
"-rtsp_transport",
|
|
||||||
"tcp",
|
|
||||||
"-timeout",
|
|
||||||
"5000000",
|
|
||||||
"-use_wallclock_as_timestamps",
|
|
||||||
"1",
|
|
||||||
]
|
|
||||||
DETECT_FFMPEG_OUTPUT_ARGS_DEFAULT = ["-f", "rawvideo", "-pix_fmt", "yuv420p"]
|
DETECT_FFMPEG_OUTPUT_ARGS_DEFAULT = ["-f", "rawvideo", "-pix_fmt", "yuv420p"]
|
||||||
RTMP_FFMPEG_OUTPUT_ARGS_DEFAULT = ["-c", "copy", "-f", "flv"]
|
RTMP_FFMPEG_OUTPUT_ARGS_DEFAULT = "preset-rtmp-generic"
|
||||||
RECORD_FFMPEG_OUTPUT_ARGS_DEFAULT = [
|
RECORD_FFMPEG_OUTPUT_ARGS_DEFAULT = "preset-record-generic"
|
||||||
"-f",
|
|
||||||
"segment",
|
|
||||||
"-segment_time",
|
|
||||||
"10",
|
|
||||||
"-segment_format",
|
|
||||||
"mp4",
|
|
||||||
"-reset_timestamps",
|
|
||||||
"1",
|
|
||||||
"-strftime",
|
|
||||||
"1",
|
|
||||||
"-c",
|
|
||||||
"copy",
|
|
||||||
"-an",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class FfmpegOutputArgsConfig(FrigateBaseModel):
|
class FfmpegOutputArgsConfig(FrigateBaseModel):
|
||||||
|
@ -77,8 +77,8 @@ class TestFfmpegPresets(unittest.TestCase):
|
|||||||
frigate_preset_config.cameras["back"].create_ffmpeg_cmds()
|
frigate_preset_config.cameras["back"].create_ffmpeg_cmds()
|
||||||
assert (
|
assert (
|
||||||
# Ignore global and user_agent args in comparison
|
# Ignore global and user_agent args in comparison
|
||||||
frigate_preset_config.cameras["back"].ffmpeg_cmds[0]["cmd"][6::]
|
frigate_preset_config.cameras["back"].ffmpeg_cmds[0]["cmd"]
|
||||||
== frigate_config.cameras["back"].ffmpeg_cmds[0]["cmd"][4::]
|
== frigate_config.cameras["back"].ffmpeg_cmds[0]["cmd"]
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_ffmpeg_input_preset(self):
|
def test_ffmpeg_input_preset(self):
|
||||||
@ -95,8 +95,10 @@ class TestFfmpegPresets(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def test_ffmpeg_input_args_as_string(self):
|
def test_ffmpeg_input_args_as_string(self):
|
||||||
argsString = " ".join(FFMPEG_INPUT_ARGS_DEFAULT) + ' -some "arg with space"'
|
# Strip user_agent args here to avoid handling quoting issues
|
||||||
argsList = FFMPEG_INPUT_ARGS_DEFAULT + ["-some", "arg with space"]
|
defaultArgsList = parse_preset_input(FFMPEG_INPUT_ARGS_DEFAULT, 5)[2::]
|
||||||
|
argsString = " ".join(defaultArgsList) + ' -some "arg with space"'
|
||||||
|
argsList = defaultArgsList + ["-some", "arg with space"]
|
||||||
self.default_ffmpeg["cameras"]["back"]["ffmpeg"]["input_args"] = argsString
|
self.default_ffmpeg["cameras"]["back"]["ffmpeg"]["input_args"] = argsString
|
||||||
frigate_config = FrigateConfig(**self.default_ffmpeg)
|
frigate_config = FrigateConfig(**self.default_ffmpeg)
|
||||||
frigate_config.cameras["back"].create_ffmpeg_cmds()
|
frigate_config.cameras["back"].create_ffmpeg_cmds()
|
||||||
|
Loading…
Reference in New Issue
Block a user