fix: resolve ffmpeg path dynamically, handle empty crop check, and strip quotes in wrapper
Build and Release Plugin / release (push) Successful in 37s
Build and Release Plugin / release (push) Successful in 37s
This commit is contained in:
@@ -9,6 +9,13 @@ namespace JellyfinPlugin
|
||||
{
|
||||
public static class CropHelper
|
||||
{
|
||||
private static string GetFFmpegPath()
|
||||
{
|
||||
if (File.Exists("/usr/lib/jellyfin-ffmpeg/ffmpeg")) return "/usr/lib/jellyfin-ffmpeg/ffmpeg";
|
||||
if (File.Exists("/usr/bin/ffmpeg")) return "/usr/bin/ffmpeg";
|
||||
return "ffmpeg";
|
||||
}
|
||||
|
||||
public static async Task<string> DetectCropAsync(string filePath, double limit)
|
||||
{
|
||||
// FFmpeg w nowych wersjach przyjmuje limit w formie ułamka, np. 24/255 to ok 0.094
|
||||
@@ -17,7 +24,7 @@ namespace JellyfinPlugin
|
||||
|
||||
var startInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "ffmpeg",
|
||||
FileName = GetFFmpegPath(),
|
||||
// KLUCZOWE: reset=1, żeby oceniał każdą klatkę niezależnie!
|
||||
Arguments = $"-skip_frame nokey -i \"{filePath}\" -vf \"cropdetect=limit={limitStr}:round=16:reset=1\" -f null -",
|
||||
RedirectStandardError = true,
|
||||
|
||||
Reference in New Issue
Block a user