From 69a1e718df4502f82e816cb1f342bec247d871d9 Mon Sep 17 00:00:00 2001
From: Jason Dove <1695733+jasongdove@users.noreply.github.com>
Date: Sat, 14 Jun 2025 18:20:22 -0500
Subject: [PATCH] use ffmpeg 7.1.1 for nvidia docker (#2038)

---
 CHANGELOG.md                                  |  1 +
 .../Health/Checks/FFmpegVersionHealthCheck.cs | 12 ++++++------
 docker/nvidia/Dockerfile                      | 19 +++++++------------
 3 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a18f647..941775b7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -42,6 +42,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 - Remove requirement to have Jellyfin admin user; user id is no longer required on requests to latest Jellyfin server
 - Upgrade bundled ffmpeg on Windows from 6.1 to 7.1.1
 - Upgrade VAAPI docker image Ubuntu base from 22 to 24; bundled ffmpeg from 6.1 to 7.1.1
+- Upgrade NVIDIA docker image Ubuntu base from 20 to 24; bundled ffmpeg from 6.1 to 7.1.1
 - Upgrade base, arm, arm64 docker images bundled ffmpeg from 6.1 to 7.1.1
 
 ### Fixed
diff --git a/ErsatzTV.Infrastructure/Health/Checks/FFmpegVersionHealthCheck.cs b/ErsatzTV.Infrastructure/Health/Checks/FFmpegVersionHealthCheck.cs
index 333a93fa..4ae97ec2 100644
--- a/ErsatzTV.Infrastructure/Health/Checks/FFmpegVersionHealthCheck.cs
+++ b/ErsatzTV.Infrastructure/Health/Checks/FFmpegVersionHealthCheck.cs
@@ -8,7 +8,7 @@ namespace ErsatzTV.Infrastructure.Health.Checks;
 
 public class FFmpegVersionHealthCheck : BaseHealthCheck, IFFmpegVersionHealthCheck
 {
-    private const string BundledVersion = "6.1";
+    private const string BundledVersion = "7.1.1";
     private const string BundledVersionVaapi = "7.1.1";
     private const string WindowsVersionPrefix = "n7.1.1";
 
@@ -78,19 +78,19 @@ public class FFmpegVersionHealthCheck : BaseHealthCheck, IFFmpegVersionHealthChe
     {
         if (version.StartsWith("3.", StringComparison.OrdinalIgnoreCase) ||
             version.StartsWith("4.", StringComparison.OrdinalIgnoreCase) ||
-            version.StartsWith("5.", StringComparison.OrdinalIgnoreCase))
+            version.StartsWith("5.", StringComparison.OrdinalIgnoreCase) ||
+            version.StartsWith("6.", StringComparison.OrdinalIgnoreCase))
         {
-            return FailResult($"{app} version {version} is too old; please install 6.1!");
+            return FailResult($"{app} version {version} is too old; please install 7.1.1!");
         }
 
-        if (!version.StartsWith("6.1", StringComparison.OrdinalIgnoreCase) &&
-            !version.StartsWith("7.1.1", StringComparison.OrdinalIgnoreCase) &&
+        if (!version.StartsWith("7.1.1", StringComparison.OrdinalIgnoreCase) &&
             !version.StartsWith(WindowsVersionPrefix, StringComparison.OrdinalIgnoreCase) &&
             version != BundledVersion &&
             version != BundledVersionVaapi)
         {
             return WarningResult(
-                $"{app} version {version} is unexpected and may have problems; please install 6.1!");
+                $"{app} version {version} is unexpected and may have problems; please install 7.1.1!");
         }
 
         return None;
diff --git a/docker/nvidia/Dockerfile b/docker/nvidia/Dockerfile
index 4c2221ed..2d7b0647 100644
--- a/docker/nvidia/Dockerfile
+++ b/docker/nvidia/Dockerfile
@@ -1,17 +1,11 @@
-FROM jasongdove/ersatztv-ffmpeg:6.1-nvidia AS runtime-base
+FROM mcr.microsoft.com/dotnet/aspnet:8.0-noble-amd64 AS dotnet-runtime
 
-RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
-    dpkg -i packages-microsoft-prod.deb && \
-    rm packages-microsoft-prod.deb && \
-    apt-get -yqq update && \
-    apt-get install -yq aspnetcore-runtime-8.0 && \
-    apt-get autoremove -y && \
-    apt-get clean -y
+FROM jasongdove/ersatztv-ffmpeg:7.1.1-nvidia AS runtime-base
+COPY --from=dotnet-runtime /usr/share/dotnet /usr/share/dotnet
 
 # https://hub.docker.com/_/microsoft-dotnet
-FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+FROM mcr.microsoft.com/dotnet/sdk:8.0-noble-amd64 AS build
 RUN apt-get update && apt-get install -y ca-certificates gnupg
-
 WORKDIR /source
 
 # copy csproj and restore as distinct layers
@@ -38,10 +32,10 @@ COPY ErsatzTV.Infrastructure.MySql/. ./ErsatzTV.Infrastructure.MySql/
 COPY ErsatzTV.Scanner/. ./ErsatzTV.Scanner/
 ARG INFO_VERSION="unknown"
 WORKDIR /source/ErsatzTV.Scanner
-RUN dotnet publish ErsatzTV.Scanner.csproj --framework net8.0 -c release -o /app -r linux-x64 --self-contained false --no-restore /p:DebugType=Embedded /p:InformationalVersion=${INFO_VERSION}
+RUN dotnet publish ErsatzTV.Scanner.csproj -c release -o /app -r linux-x64 --self-contained false --no-restore /p:DebugType=Embedded /p:InformationalVersion=${INFO_VERSION}
 WORKDIR /source/ErsatzTV
 RUN sed -i '/Scanner/d' ErsatzTV.csproj
-RUN dotnet publish ErsatzTV.csproj --framework net8.0 -c release -o /app -r linux-x64 --self-contained false --no-restore /p:DebugType=Embedded /p:InformationalVersion=${INFO_VERSION}
+RUN dotnet publish ErsatzTV.csproj -c release -o /app -r linux-x64 --self-contained false --no-restore /p:DebugType=Embedded /p:InformationalVersion=${INFO_VERSION}
 
 # final stage/image
 FROM runtime-base
@@ -51,4 +45,5 @@ WORKDIR /app
 COPY --from=build /app ./
 ENV ETV_CONFIG_FOLDER=/config
 ENV ETV_TRANSCODE_FOLDER=/transcode
+ENV ETV_DISABLE_VULKAN=1
 ENTRYPOINT ["./ErsatzTV"]