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 <noreply@anthropic.com>
This commit is contained in:
@@ -97,13 +97,19 @@ namespace Jellyfin.Plugin.CinemaTrailers4Jellyfins.Services
|
|||||||
"-shortest",
|
"-shortest",
|
||||||
"-c:v libx264 -tune stillimage -pix_fmt yuv420p",
|
"-c:v libx264 -tune stillimage -pix_fmt yuv420p",
|
||||||
"-c:a aac -b:a 64k",
|
"-c:a aac -b:a 64k",
|
||||||
|
"-f mp4",
|
||||||
$"\"{tempPath}\"");
|
$"\"{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
|
using var process = new Process
|
||||||
{
|
{
|
||||||
StartInfo = new ProcessStartInfo
|
StartInfo = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = "ffmpeg",
|
FileName = ffmpegPath,
|
||||||
Arguments = args,
|
Arguments = args,
|
||||||
RedirectStandardOutput = true,
|
RedirectStandardOutput = true,
|
||||||
RedirectStandardError = true,
|
RedirectStandardError = true,
|
||||||
@@ -135,7 +141,7 @@ namespace Jellyfin.Plugin.CinemaTrailers4Jellyfins.Services
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
Reference in New Issue
Block a user