Fix gpu stats for ffmpeg presets (#4554)

This commit is contained in:
Nicolas Mowen 2022-11-29 18:56:01 -07:00 committed by GitHub
parent 87144cd572
commit 25a7c4ee81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,7 +125,7 @@ async def set_gpu_stats(config: FrigateConfig, all_stats: dict[str, Any]) -> Non
stats: dict[str, dict] = {}
for args in hwaccel_args:
if "cuvid" in args:
if "cuvid" in args or "nvidia" in args:
# nvidia GPU
nvidia_usage = get_nvidia_gpu_stats()
@ -162,7 +162,7 @@ async def set_gpu_stats(config: FrigateConfig, all_stats: dict[str, Any]) -> Non
stats["intel-vaapi"] = intel_usage
else:
stats["intel-vaapi"] = {"gpu": -1, "mem": -1}
elif "v4l2m2m" in args:
elif "v4l2m2m" in args or "rpi" in args:
# RPi v4l2m2m is currently not able to get usage stats
stats["rpi-v4l2m2m"] = {"gpu": -1, "mem": -1}