mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Don't recheck erroring hwaccel in http either (#4935)
* Don't recheck erroring hwaccel in http either * Send error instead of empty for known erroring hwaccel * Formatting
This commit is contained in:
parent
417a42b0b3
commit
d9c45a76fe
@ -76,6 +76,7 @@ def create_app(
|
|||||||
app.storage_maintainer = storage_maintainer
|
app.storage_maintainer = storage_maintainer
|
||||||
app.plus_api = plus_api
|
app.plus_api = plus_api
|
||||||
app.camera_error_image = None
|
app.camera_error_image = None
|
||||||
|
app.hwaccel_errors = []
|
||||||
|
|
||||||
app.register_blueprint(bp)
|
app.register_blueprint(bp)
|
||||||
|
|
||||||
@ -761,7 +762,11 @@ def version():
|
|||||||
|
|
||||||
@bp.route("/stats")
|
@bp.route("/stats")
|
||||||
def stats():
|
def stats():
|
||||||
stats = stats_snapshot(current_app.frigate_config, current_app.stats_tracking, [])
|
stats = stats_snapshot(
|
||||||
|
current_app.frigate_config,
|
||||||
|
current_app.stats_tracking,
|
||||||
|
current_app.hwaccel_errors,
|
||||||
|
)
|
||||||
return jsonify(stats)
|
return jsonify(stats)
|
||||||
|
|
||||||
|
|
||||||
@ -861,7 +866,9 @@ def latest_frame(camera_name):
|
|||||||
@bp.route("/recordings/storage", methods=["GET"])
|
@bp.route("/recordings/storage", methods=["GET"])
|
||||||
def get_recordings_storage_usage():
|
def get_recordings_storage_usage():
|
||||||
recording_stats = stats_snapshot(
|
recording_stats = stats_snapshot(
|
||||||
current_app.frigate_config, current_app.stats_tracking, []
|
current_app.frigate_config,
|
||||||
|
current_app.stats_tracking,
|
||||||
|
current_app.hwaccel_errors,
|
||||||
)["service"]["storage"][RECORD_DIR]
|
)["service"]["storage"][RECORD_DIR]
|
||||||
total_mb = recording_stats["total"]
|
total_mb = recording_stats["total"]
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ async def set_gpu_stats(
|
|||||||
if isinstance(args, list):
|
if isinstance(args, list):
|
||||||
args = " ".join(args)
|
args = " ".join(args)
|
||||||
|
|
||||||
if args and args not in hwaccel_args and args not in hwaccel_errors:
|
if args and args not in hwaccel_args:
|
||||||
hwaccel_args.append(args)
|
hwaccel_args.append(args)
|
||||||
|
|
||||||
for stream_input in camera.ffmpeg.inputs:
|
for stream_input in camera.ffmpeg.inputs:
|
||||||
@ -138,7 +138,10 @@ async def set_gpu_stats(
|
|||||||
stats: dict[str, dict] = {}
|
stats: dict[str, dict] = {}
|
||||||
|
|
||||||
for args in hwaccel_args:
|
for args in hwaccel_args:
|
||||||
if "cuvid" in args or "nvidia" in args:
|
if args in hwaccel_errors:
|
||||||
|
# known erroring args should automatically return as error
|
||||||
|
stats["error-gpu"] = {"gpu": -1, "mem": -1}
|
||||||
|
elif "cuvid" in args or "nvidia" in args:
|
||||||
# nvidia GPU
|
# nvidia GPU
|
||||||
nvidia_usage = get_nvidia_gpu_stats()
|
nvidia_usage = get_nvidia_gpu_stats()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user