From d84541ec6e6582a16d006db18cd704f0d55e608b Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Wed, 30 Nov 2022 00:08:58 -0300 Subject: [PATCH] Set User Agent for FFmpeg calls --- .gitignore | 3 ++- .vscode/launch.json | 11 +++++++++++ docs/docs/configuration/index.md | 2 +- frigate/config.py | 9 ++++++++- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.gitignore b/.gitignore index 6fe616b5c..f12f7725b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,8 @@ *.pyc *.swp debug -.vscode +.vscode/** +!.vscode/launch.json config/config.yml models *.mp4 diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..08bc9fb62 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "configurations": [ + { + "name": "Python: Frigate", + "type": "python", + "request": "launch", + "module": "frigate", + "justMyCode": true + } + ] +} diff --git a/docs/docs/configuration/index.md b/docs/docs/configuration/index.md index 26f089695..a550f4de6 100644 --- a/docs/docs/configuration/index.md +++ b/docs/docs/configuration/index.md @@ -142,7 +142,7 @@ birdseye: # Optional: ffmpeg configuration ffmpeg: # Optional: global ffmpeg args (default: shown below) - global_args: -hide_banner -loglevel warning + global_args: -hide_banner -loglevel warning -user_agent "FFmpeg Frigate" # Optional: global hwaccel args (default: shown below) # NOTE: See hardware acceleration docs for your specific device hwaccel_args: [] diff --git a/frigate/config.py b/frigate/config.py index ca6ead667..249377c00 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -32,6 +32,7 @@ from frigate.ffmpeg_presets import ( parse_preset_output_record, parse_preset_output_rtmp, ) +from frigate.version import VERSION logger = logging.getLogger(__name__) @@ -357,7 +358,13 @@ class BirdseyeCameraConfig(BaseModel): ) -FFMPEG_GLOBAL_ARGS_DEFAULT = ["-hide_banner", "-loglevel", "warning"] +FFMPEG_GLOBAL_ARGS_DEFAULT = [ + "-hide_banner", + "-loglevel", + "warning", + "-user_agent", + f"FFmpeg Frigate/{VERSION}", +] FFMPEG_INPUT_ARGS_DEFAULT = [ "-avoid_negative_ts", "make_zero",