From 848b88bd2d30fa8ca35bf58dd3af6982fdc0cdc6 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Wed, 16 Jul 2025 17:13:25 +0000 Subject: [PATCH] link ffmpeg health check to ersatztv-ffmpeg release (#2154) * link ffmpeg health check to ersatztv-ffmpeg release * bump windows ffmpeg to use the same version as linux --- .github/workflows/artifacts.yml | 2 +- CHANGELOG.md | 1 + .../Health/Checks/BaseHealthCheck.cs | 3 +++ .../Health/Checks/FFmpegVersionHealthCheck.cs | 20 ++++++++++--------- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index fec05bee..bc31add1 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -182,7 +182,7 @@ jobs: id: downloadffmpeg name: Download ffmpeg with: - url: "https://github.com/ErsatzTV/ErsatzTV-ffmpeg/releases/download/7.1.1/ffmpeg-n7.1.1-22-g0f1fe3d153-win64-gpl-7.1.zip" + url: "https://github.com/ErsatzTV/ErsatzTV-ffmpeg/releases/download/7.1.1/ffmpeg-n7.1.1-56-gc2184b65d2-win64-gpl-7.1.zip" target: ffmpeg/ - name: Build diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d3cfdb8..43694eb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Block items that have this checked will never display a watermark, even with Deco set to override watermark - Add `ETV_MAXIMUM_UPLOAD_MB` environment variable to allow uploading large watermarks - Default value is 10 +- Update ffmpeg health check to link to ErsatzTV-FFmpeg release that contains binaries for win64, linux64, linuxarm64 ### Changed - Allow `Other Video` libraries and `Image` libraries to use the same folders diff --git a/ErsatzTV.Infrastructure/Health/Checks/BaseHealthCheck.cs b/ErsatzTV.Infrastructure/Health/Checks/BaseHealthCheck.cs index 64d419cb..544f4fdc 100644 --- a/ErsatzTV.Infrastructure/Health/Checks/BaseHealthCheck.cs +++ b/ErsatzTV.Infrastructure/Health/Checks/BaseHealthCheck.cs @@ -21,6 +21,9 @@ public abstract class BaseHealthCheck protected HealthCheckResult FailResult(string message, string briefMessage) => new(Title, HealthCheckStatus.Fail, message, briefMessage, None); + protected HealthCheckResult FailResult(string message, string briefMessage, HealthCheckLink link) => + new(Title, HealthCheckStatus.Fail, message, briefMessage, link); + protected HealthCheckResult WarningResult(string message, string briefMessage) => new(Title, HealthCheckStatus.Warning, message, briefMessage, None); diff --git a/ErsatzTV.Infrastructure/Health/Checks/FFmpegVersionHealthCheck.cs b/ErsatzTV.Infrastructure/Health/Checks/FFmpegVersionHealthCheck.cs index be541470..b8d38af4 100644 --- a/ErsatzTV.Infrastructure/Health/Checks/FFmpegVersionHealthCheck.cs +++ b/ErsatzTV.Infrastructure/Health/Checks/FFmpegVersionHealthCheck.cs @@ -23,18 +23,20 @@ public class FFmpegVersionHealthCheck : BaseHealthCheck, IFFmpegVersionHealthChe public async Task Check(CancellationToken cancellationToken) { + var link = new HealthCheckLink("https://github.com/ErsatzTV/ErsatzTV-ffmpeg/releases/tag/7.1.1"); + Option maybeFFmpegPath = await _configElementRepository.GetConfigElement(ConfigElementKey.FFmpegPath); if (maybeFFmpegPath.IsNone) { - return FailResult("Unable to locate ffmpeg", "Unable to locate ffmpeg"); + return FailResult("Unable to locate ffmpeg", "Unable to locate ffmpeg", link); } Option maybeFFprobePath = await _configElementRepository.GetConfigElement(ConfigElementKey.FFprobePath); if (maybeFFprobePath.IsNone) { - return FailResult("Unable to locate ffprobe", "Unable to locate ffprobe"); + return FailResult("Unable to locate ffprobe", "Unable to locate ffprobe", link); } foreach (ConfigElement ffmpegPath in maybeFFmpegPath) @@ -42,12 +44,12 @@ public class FFmpegVersionHealthCheck : BaseHealthCheck, IFFmpegVersionHealthChe Option maybeVersion = await GetVersion(ffmpegPath.Value, cancellationToken); if (maybeVersion.IsNone) { - return WarningResult("Unable to determine ffmpeg version", "Unable to determine ffmpeg version"); + return WarningResult("Unable to determine ffmpeg version", "Unable to determine ffmpeg version", link); } foreach (string version in maybeVersion) { - foreach (HealthCheckResult result in ValidateVersion(version, "ffmpeg")) + foreach (HealthCheckResult result in ValidateVersion(version, "ffmpeg", link)) { return result; } @@ -59,12 +61,12 @@ public class FFmpegVersionHealthCheck : BaseHealthCheck, IFFmpegVersionHealthChe Option maybeVersion = await GetVersion(ffprobePath.Value, cancellationToken); if (maybeVersion.IsNone) { - return WarningResult("Unable to determine ffprobe version", "Unable to determine ffprobe version"); + return WarningResult("Unable to determine ffprobe version", "Unable to determine ffprobe version", link); } foreach (string version in maybeVersion) { - foreach (HealthCheckResult result in ValidateVersion(version, "ffprobe")) + foreach (HealthCheckResult result in ValidateVersion(version, "ffprobe", link)) { return result; } @@ -74,14 +76,14 @@ public class FFmpegVersionHealthCheck : BaseHealthCheck, IFFmpegVersionHealthChe return new HealthCheckResult("FFmpeg Version", HealthCheckStatus.Pass, string.Empty, string.Empty, None); } - private Option ValidateVersion(string version, string app) + private Option ValidateVersion(string version, string app, HealthCheckLink link) { if (version.StartsWith("3.", StringComparison.OrdinalIgnoreCase) || version.StartsWith("4.", StringComparison.OrdinalIgnoreCase) || version.StartsWith("5.", StringComparison.OrdinalIgnoreCase) || version.StartsWith("6.", StringComparison.OrdinalIgnoreCase)) { - return FailResult($"{app} version {version} is too old; please install 7.1.1!", $"{app} version is too old"); + return FailResult($"{app} version {version} is too old; please install 7.1.1!", $"{app} version is too old", link); } if (!version.StartsWith("7.1.1", StringComparison.OrdinalIgnoreCase) && @@ -90,7 +92,7 @@ public class FFmpegVersionHealthCheck : BaseHealthCheck, IFFmpegVersionHealthChe version != BundledVersionVaapi) { return WarningResult( - $"{app} version {version} is unexpected and may have problems; please install 7.1.1!", $"{app} version is unexpected"); + $"{app} version {version} is unexpected and may have problems; please install 7.1.1!", $"{app} version is unexpected", link); } return None;