mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Fix order
This commit is contained in:
parent
7c88bfb0d2
commit
f2a5b9e650
@ -129,22 +129,7 @@ PRESETS_HW_ACCEL_SCALE = {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
PRESETS_HW_ACCEL_ENCODE_TO_RTSP = {
|
PRESETS_HW_ACCEL_ENCODE = {
|
||||||
"default": [
|
|
||||||
"-c:v",
|
|
||||||
"libx264",
|
|
||||||
"-g",
|
|
||||||
"50",
|
|
||||||
"-profile:v",
|
|
||||||
"high",
|
|
||||||
"-level:v",
|
|
||||||
"4.1",
|
|
||||||
"-preset:v",
|
|
||||||
"superfast",
|
|
||||||
"-tune:v",
|
|
||||||
"zerolatency",
|
|
||||||
],
|
|
||||||
"preset-rpi-64-h264": ["-c:v", "h264_v4l2m2m", "-g", "50", "-bf", "0"],
|
|
||||||
"preset-intel-vaapi": [
|
"preset-intel-vaapi": [
|
||||||
"-c:v",
|
"-c:v",
|
||||||
"h264_vaapi",
|
"h264_vaapi",
|
||||||
@ -156,9 +141,51 @@ PRESETS_HW_ACCEL_ENCODE_TO_RTSP = {
|
|||||||
"high",
|
"high",
|
||||||
"-level:v",
|
"-level:v",
|
||||||
"4.1",
|
"4.1",
|
||||||
|
"-sei:v",
|
||||||
|
"0",
|
||||||
|
],
|
||||||
|
"preset-intel-qsv-h264": [
|
||||||
|
"-c:v",
|
||||||
|
"h264_qsv",
|
||||||
|
"-g",
|
||||||
|
"50",
|
||||||
|
"-bf",
|
||||||
|
"0",
|
||||||
|
"-profile:v",
|
||||||
|
"high",
|
||||||
|
"-level:v",
|
||||||
|
"4.1",
|
||||||
|
"-async_depth:v",
|
||||||
|
"1",
|
||||||
|
],
|
||||||
|
"preset-intel-qsv-h265": [
|
||||||
|
"-c:v",
|
||||||
|
"h264_qsv",
|
||||||
|
"-g",
|
||||||
|
"50",
|
||||||
|
"-bf",
|
||||||
|
"0",
|
||||||
|
"-profile:v",
|
||||||
|
"high",
|
||||||
|
"-level:v",
|
||||||
|
"4.1",
|
||||||
|
"-async_depth:v",
|
||||||
|
"1",
|
||||||
|
],
|
||||||
|
"preset-amd-vaapi": [
|
||||||
|
"-c:v",
|
||||||
|
"h264_vaapi",
|
||||||
|
"-g",
|
||||||
|
"50",
|
||||||
|
"-bf",
|
||||||
|
"0",
|
||||||
|
"-profile:v",
|
||||||
|
"high",
|
||||||
|
"-level:v",
|
||||||
|
"4.1",
|
||||||
|
"-sei:v",
|
||||||
|
"0",
|
||||||
],
|
],
|
||||||
"preset-intel-qsv-h264": ["-c:v", "h264_qsv"],
|
|
||||||
"preset-intel-qsv-h265": ["-c:v", "hevc_qsv"],
|
|
||||||
"preset-nvidia-h264": [
|
"preset-nvidia-h264": [
|
||||||
"-c:v",
|
"-c:v",
|
||||||
"h264_nvenc",
|
"h264_nvenc",
|
||||||
@ -173,8 +200,37 @@ PRESETS_HW_ACCEL_ENCODE_TO_RTSP = {
|
|||||||
"-tune:v",
|
"-tune:v",
|
||||||
"ll",
|
"ll",
|
||||||
],
|
],
|
||||||
|
"preset-nvidia-h265": [
|
||||||
|
"-c:v",
|
||||||
|
"h264_nvenc",
|
||||||
|
"-g",
|
||||||
|
"50",
|
||||||
|
"-profile:v",
|
||||||
|
"high",
|
||||||
|
"-level:v",
|
||||||
|
"auto",
|
||||||
|
"-preset:v",
|
||||||
|
"p2",
|
||||||
|
"-tune:v",
|
||||||
|
"ll",
|
||||||
|
],
|
||||||
|
"default": [
|
||||||
|
"-c:v",
|
||||||
|
"libx264",
|
||||||
|
"-g",
|
||||||
|
"50",
|
||||||
|
"-profile:v",
|
||||||
|
"high",
|
||||||
|
"-level:v",
|
||||||
|
"4.1",
|
||||||
|
"-preset:v",
|
||||||
|
"superfast",
|
||||||
|
"-tune:v",
|
||||||
|
"zerolatency",
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def parse_preset_hardware_acceleration_decode(arg: Any) -> list[str]:
|
def parse_preset_hardware_acceleration_decode(arg: Any) -> list[str]:
|
||||||
"""Return the correct preset if in preset format otherwise return None."""
|
"""Return the correct preset if in preset format otherwise return None."""
|
||||||
if not isinstance(arg, str):
|
if not isinstance(arg, str):
|
||||||
@ -202,6 +258,14 @@ def parse_preset_hardware_acceleration_scale(
|
|||||||
return scale
|
return scale
|
||||||
|
|
||||||
|
|
||||||
|
def parse_preset_hardware_acceleration_encode(arg: Any) -> list[str]:
|
||||||
|
"""Return the correct scaling preset or default preset if none is set."""
|
||||||
|
if not isinstance(arg, str):
|
||||||
|
return PRESETS_HW_ACCEL_ENCODE["default"]
|
||||||
|
|
||||||
|
return PRESETS_HW_ACCEL_ENCODE.get(arg, PRESETS_HW_ACCEL_ENCODE["default"])
|
||||||
|
|
||||||
|
|
||||||
PRESETS_INPUT = {
|
PRESETS_INPUT = {
|
||||||
"preset-http-jpeg-generic": _user_agent_args
|
"preset-http-jpeg-generic": _user_agent_args
|
||||||
+ [
|
+ [
|
||||||
@ -322,108 +386,6 @@ PRESETS_INPUT = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PRESETS_HW_ACCEL_ENCODE = {
|
|
||||||
"preset-intel-vaapi": [
|
|
||||||
"-c:v",
|
|
||||||
"h264_vaapi",
|
|
||||||
"-g",
|
|
||||||
"50",
|
|
||||||
"-bf",
|
|
||||||
"0",
|
|
||||||
"-profile:v",
|
|
||||||
"high",
|
|
||||||
"-level:v",
|
|
||||||
"4.1",
|
|
||||||
"-sei:v",
|
|
||||||
"0",
|
|
||||||
],
|
|
||||||
"preset-intel-qsv-h264": [
|
|
||||||
"-c:v",
|
|
||||||
"h264_qsv",
|
|
||||||
"-g",
|
|
||||||
"50",
|
|
||||||
"-bf",
|
|
||||||
"0",
|
|
||||||
"-profile:v",
|
|
||||||
"high",
|
|
||||||
"-level:v",
|
|
||||||
"4.1",
|
|
||||||
"-async_depth:v",
|
|
||||||
"1",
|
|
||||||
],
|
|
||||||
"preset-intel-qsv-h265": [
|
|
||||||
"-c:v",
|
|
||||||
"h264_qsv",
|
|
||||||
"-g",
|
|
||||||
"50",
|
|
||||||
"-bf",
|
|
||||||
"0",
|
|
||||||
"-profile:v",
|
|
||||||
"high",
|
|
||||||
"-level:v",
|
|
||||||
"4.1",
|
|
||||||
"-async_depth:v",
|
|
||||||
"1",
|
|
||||||
],
|
|
||||||
"preset-amd-vaapi": [
|
|
||||||
"-c:v",
|
|
||||||
"h264_vaapi",
|
|
||||||
"-g",
|
|
||||||
"50",
|
|
||||||
"-bf",
|
|
||||||
"0",
|
|
||||||
"-profile:v",
|
|
||||||
"high",
|
|
||||||
"-level:v",
|
|
||||||
"4.1",
|
|
||||||
"-sei:v",
|
|
||||||
"0",
|
|
||||||
],
|
|
||||||
"preset-nvidia-h264": [
|
|
||||||
"-c:v",
|
|
||||||
"h264_nvenc",
|
|
||||||
"-g",
|
|
||||||
"50",
|
|
||||||
"-profile:v",
|
|
||||||
"high",
|
|
||||||
"-level:v",
|
|
||||||
"auto",
|
|
||||||
"-preset:v",
|
|
||||||
"p2",
|
|
||||||
"-tune:v",
|
|
||||||
"ll",
|
|
||||||
],
|
|
||||||
"preset-nvidia-h265": [
|
|
||||||
"-c:v",
|
|
||||||
"h264_nvenc",
|
|
||||||
"-g",
|
|
||||||
"50",
|
|
||||||
"-profile:v",
|
|
||||||
"high",
|
|
||||||
"-level:v",
|
|
||||||
"auto",
|
|
||||||
"-preset:v",
|
|
||||||
"p2",
|
|
||||||
"-tune:v",
|
|
||||||
"ll",
|
|
||||||
],
|
|
||||||
"default": [
|
|
||||||
"-c:v",
|
|
||||||
"libx264",
|
|
||||||
"-g",
|
|
||||||
"50",
|
|
||||||
"-profile:v",
|
|
||||||
"high",
|
|
||||||
"-level:v",
|
|
||||||
"4.1",
|
|
||||||
"-preset:v",
|
|
||||||
"superfast",
|
|
||||||
"-tune:v",
|
|
||||||
"zerolatency",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def parse_preset_input(arg: Any, detect_fps: int) -> list[str]:
|
def parse_preset_input(arg: Any, detect_fps: int) -> list[str]:
|
||||||
"""Return the correct preset if in preset format otherwise return None."""
|
"""Return the correct preset if in preset format otherwise return None."""
|
||||||
if not isinstance(arg, str):
|
if not isinstance(arg, str):
|
||||||
@ -437,14 +399,6 @@ def parse_preset_input(arg: Any, detect_fps: int) -> list[str]:
|
|||||||
return PRESETS_INPUT.get(arg, None)
|
return PRESETS_INPUT.get(arg, None)
|
||||||
|
|
||||||
|
|
||||||
def parse_preset_hardware_acceleration_encode(arg: Any) -> list[str]:
|
|
||||||
"""Return the correct scaling preset or default preset if none is set."""
|
|
||||||
if not isinstance(arg, str):
|
|
||||||
return PRESETS_HW_ACCEL_ENCODE["default"]
|
|
||||||
|
|
||||||
return PRESETS_HW_ACCEL_ENCODE.get(arg, PRESETS_HW_ACCEL_ENCODE["default"])
|
|
||||||
|
|
||||||
|
|
||||||
PRESETS_RECORD_OUTPUT = {
|
PRESETS_RECORD_OUTPUT = {
|
||||||
"preset-record-generic": [
|
"preset-record-generic": [
|
||||||
"-f",
|
"-f",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user