Set User Agent for FFmpeg calls

This commit is contained in:
Felipe Santos 2022-11-30 00:08:58 -03:00
parent 5ad391977e
commit d84541ec6e
4 changed files with 22 additions and 3 deletions

3
.gitignore vendored
View File

@ -2,7 +2,8 @@
*.pyc *.pyc
*.swp *.swp
debug debug
.vscode .vscode/**
!.vscode/launch.json
config/config.yml config/config.yml
models models
*.mp4 *.mp4

11
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,11 @@
{
"configurations": [
{
"name": "Python: Frigate",
"type": "python",
"request": "launch",
"module": "frigate",
"justMyCode": true
}
]
}

View File

@ -142,7 +142,7 @@ birdseye:
# Optional: ffmpeg configuration # Optional: ffmpeg configuration
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 -user_agent "FFmpeg Frigate"
# Optional: global hwaccel args (default: shown below) # Optional: global hwaccel args (default: shown below)
# NOTE: See hardware acceleration docs for your specific device # NOTE: See hardware acceleration docs for your specific device
hwaccel_args: [] hwaccel_args: []

View File

@ -32,6 +32,7 @@ from frigate.ffmpeg_presets import (
parse_preset_output_record, parse_preset_output_record,
parse_preset_output_rtmp, parse_preset_output_rtmp,
) )
from frigate.version import VERSION
logger = logging.getLogger(__name__) 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 = [ FFMPEG_INPUT_ARGS_DEFAULT = [
"-avoid_negative_ts", "-avoid_negative_ts",
"make_zero", "make_zero",