mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-10 02:29:19 +03:00
Some checks are pending
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
* face recognition dynamic config * lpr dynamic config * safe changes for birdseye dynamic config * bird classification dynamic config * always assign new config to stats emitter to make telemetry fields dynamic * add wildcard support for camera config updates in config_set * update restart required fields for global sections * add test * fix rebase issue * collapsible settings sidebar use the preexisting control available with shadcn's sidebar (cmd/ctrl-B) to give users more space to set masks/zones on smaller screens * dynamic ffmpeg * ensure previews dir exists when ffmpeg processes restart, there's a brief window where the preview frame generation pipeline is torn down and restarted. before these changes, ffmpeg only restarted on crash/stall recovery or full Frigate restart. Now that ffmpeg restarts happen on-demand via config changes, there's a higher chance a frontend request hits the preview_mp4 or preview_gif endpoints during that brief restart window when the directory might not exist yet. The existing os.listdir() call would throw FileNotFoundError without a directory existence check. this fix just checks if the directory exists and returns 404 if not, exactly how preview_thumbnail already handles the same scenario a few lines below * global ffmpeg section * clean up * tweak * fix test
161 lines
4.1 KiB
TypeScript
161 lines
4.1 KiB
TypeScript
import type { SectionConfigOverrides } from "./types";
|
|
|
|
const arrayAsTextWidget = {
|
|
"ui:widget": "ArrayAsTextWidget",
|
|
"ui:options": {
|
|
suppressMultiSchema: true,
|
|
},
|
|
};
|
|
|
|
const ffmpegArgsWidget = (
|
|
presetField: string,
|
|
extraOptions?: Record<string, unknown>,
|
|
) => ({
|
|
"ui:widget": "FfmpegArgsWidget",
|
|
"ui:options": {
|
|
suppressMultiSchema: true,
|
|
ffmpegPresetField: presetField,
|
|
...extraOptions,
|
|
},
|
|
});
|
|
|
|
const ffmpeg: SectionConfigOverrides = {
|
|
base: {
|
|
sectionDocs: "/configuration/ffmpeg_presets",
|
|
fieldDocs: {
|
|
hwaccel_args: "/configuration/ffmpeg_presets#hwaccel-presets",
|
|
"inputs.hwaccel_args": "/configuration/ffmpeg_presets#hwaccel-presets",
|
|
input_args: "/configuration/ffmpeg_presets#input-args-presets",
|
|
"inputs.input_args": "/configuration/ffmpeg_presets#input-args-presets",
|
|
output_args: "/configuration/ffmpeg_presets#output-args-presets",
|
|
"inputs.output_args": "/configuration/ffmpeg_presets#output-args-presets",
|
|
"output_args.record": "/configuration/ffmpeg_presets#output-args-presets",
|
|
"inputs.roles": "/configuration/cameras/#setting-up-camera-inputs",
|
|
},
|
|
restartRequired: [],
|
|
fieldOrder: [
|
|
"inputs",
|
|
"global_args",
|
|
"input_args",
|
|
"hwaccel_args",
|
|
"output_args",
|
|
"path",
|
|
"retry_interval",
|
|
"apple_compatibility",
|
|
"gpu",
|
|
],
|
|
hiddenFields: [],
|
|
advancedFields: [
|
|
"path",
|
|
"global_args",
|
|
"retry_interval",
|
|
"apple_compatibility",
|
|
"gpu",
|
|
],
|
|
overrideFields: [
|
|
"inputs",
|
|
"path",
|
|
"global_args",
|
|
"input_args",
|
|
"hwaccel_args",
|
|
"output_args",
|
|
"retry_interval",
|
|
"apple_compatibility",
|
|
"gpu",
|
|
],
|
|
uiSchema: {
|
|
path: {
|
|
"ui:options": { size: "md" },
|
|
},
|
|
global_args: arrayAsTextWidget,
|
|
hwaccel_args: ffmpegArgsWidget("hwaccel_args"),
|
|
input_args: ffmpegArgsWidget("input_args"),
|
|
output_args: {
|
|
detect: arrayAsTextWidget,
|
|
record: ffmpegArgsWidget("output_args.record"),
|
|
items: {
|
|
detect: arrayAsTextWidget,
|
|
record: ffmpegArgsWidget("output_args.record"),
|
|
},
|
|
},
|
|
inputs: {
|
|
"ui:field": "CameraInputsField",
|
|
items: {
|
|
path: {
|
|
"ui:options": { size: "full" },
|
|
},
|
|
roles: {
|
|
"ui:widget": "inputRoles",
|
|
"ui:options": {
|
|
showArrayItemDescription: true,
|
|
},
|
|
},
|
|
global_args: {
|
|
"ui:widget": "hidden",
|
|
},
|
|
hwaccel_args: ffmpegArgsWidget("hwaccel_args", {
|
|
allowInherit: true,
|
|
hideDescription: true,
|
|
forceSplitLayout: true,
|
|
showArrayItemDescription: true,
|
|
}),
|
|
input_args: ffmpegArgsWidget("input_args", {
|
|
allowInherit: true,
|
|
hideDescription: true,
|
|
forceSplitLayout: true,
|
|
showArrayItemDescription: true,
|
|
}),
|
|
output_args: {
|
|
items: {
|
|
detect: arrayAsTextWidget,
|
|
record: ffmpegArgsWidget("output_args.record"),
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
global: {
|
|
restartRequired: [],
|
|
fieldOrder: [
|
|
"hwaccel_args",
|
|
"path",
|
|
"global_args",
|
|
"input_args",
|
|
"output_args",
|
|
"retry_interval",
|
|
"apple_compatibility",
|
|
"gpu",
|
|
],
|
|
advancedFields: [
|
|
"global_args",
|
|
"input_args",
|
|
"output_args",
|
|
"path",
|
|
"retry_interval",
|
|
"apple_compatibility",
|
|
"gpu",
|
|
],
|
|
uiSchema: {
|
|
path: {
|
|
"ui:options": { size: "md" },
|
|
},
|
|
global_args: arrayAsTextWidget,
|
|
hwaccel_args: ffmpegArgsWidget("hwaccel_args"),
|
|
input_args: ffmpegArgsWidget("input_args"),
|
|
output_args: {
|
|
detect: arrayAsTextWidget,
|
|
record: ffmpegArgsWidget("output_args.record"),
|
|
},
|
|
},
|
|
},
|
|
camera: {
|
|
fieldGroups: {
|
|
cameraFfmpeg: ["input_args", "hwaccel_args", "output_args"],
|
|
},
|
|
restartRequired: [],
|
|
},
|
|
};
|
|
|
|
export default ffmpeg;
|