From c83d7cbdde3ccd7625c5a87a318ac362105b0caf Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 8 Jun 2026 16:48:35 -0400 Subject: [PATCH] fix: use jellyfin-ffmpeg and explicit -f mp4 for fake-movie generation Two issues prevented fake-movie generation: - ffmpeg was invoked by bare name, but only /usr/lib/jellyfin-ffmpeg/ffmpeg exists on the host (Jellyfin's bundled copy, not on PATH). Now probing that path first with fallback to PATH. - The temp file extension .tmp caused ffmpeg to fail with "Unable to choose an output format" since it auto-detects the container from the extension. Added -f mp4 to specify the format explicitly. Co-Authored-By: Claude Sonnet 4.6 --- .../Services/FakeMovieService.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Services/FakeMovieService.cs b/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Services/FakeMovieService.cs index ec070ef..cc265b2 100644 --- a/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Services/FakeMovieService.cs +++ b/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Services/FakeMovieService.cs @@ -97,13 +97,19 @@ namespace Jellyfin.Plugin.CinemaTrailers4Jellyfins.Services "-shortest", "-c:v libx264 -tune stillimage -pix_fmt yuv420p", "-c:a aac -b:a 64k", + "-f mp4", $"\"{tempPath}\""); + // Prefer Jellyfin's bundled ffmpeg; fall back to whatever is on PATH. + var ffmpegPath = File.Exists("/usr/lib/jellyfin-ffmpeg/ffmpeg") + ? "/usr/lib/jellyfin-ffmpeg/ffmpeg" + : "ffmpeg"; + using var process = new Process { StartInfo = new ProcessStartInfo { - FileName = "ffmpeg", + FileName = ffmpegPath, Arguments = args, RedirectStandardOutput = true, RedirectStandardError = true, @@ -135,7 +141,7 @@ namespace Jellyfin.Plugin.CinemaTrailers4Jellyfins.Services } catch (Exception ex) { - _logger.LogError(ex, "|CinemaTrailers4Jellyfins| Failed to generate the master fake-movie file. Is ffmpeg installed and on PATH?"); + _logger.LogError(ex, "|CinemaTrailers4Jellyfins| Failed to generate the master fake-movie file."); return false; } finally