diff options
Diffstat (limited to 'MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs')
| -rw-r--r-- | MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index a865b0e4c..6c43be3ab 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -62,10 +62,6 @@ namespace MediaBrowser.MediaEncoding.Encoder "libx264", "libx265", "libsvtav1", - "mpeg4", - "msmpeg4", - "libvpx", - "libvpx-vp9", "aac", "aac_at", "libfdk_aac", @@ -116,25 +112,31 @@ namespace MediaBrowser.MediaEncoding.Encoder "yadif_cuda", "tonemap_cuda", "overlay_cuda", + "transpose_cuda", "hwupload_cuda", // opencl "scale_opencl", "tonemap_opencl", "overlay_opencl", + "transpose_opencl", // vaapi "scale_vaapi", "deinterlace_vaapi", "tonemap_vaapi", "procamp_vaapi", "overlay_vaapi", + "transpose_vaapi", "hwupload_vaapi", // vulkan "libplacebo", "scale_vulkan", "overlay_vulkan", + "transpose_vulkan", + "flip_vulkan", // videotoolbox "yadif_videotoolbox", "scale_vt", + "transpose_vt", "overlay_videotoolbox", "tonemap_videotoolbox", // rkrga @@ -150,7 +152,8 @@ namespace MediaBrowser.MediaEncoding.Encoder { 2, new string[] { "tonemap_opencl", "bt2390" } }, { 3, new string[] { "overlay_opencl", "Action to take when encountering EOF from secondary input" } }, { 4, new string[] { "overlay_vaapi", "Action to take when encountering EOF from secondary input" } }, - { 5, new string[] { "overlay_vulkan", "Action to take when encountering EOF from secondary input" } } + { 5, new string[] { "overlay_vulkan", "Action to take when encountering EOF from secondary input" } }, + { 6, new string[] { "transpose_opencl", "rotate by half-turn" } } }; // These are the library versions that corresponds to our minimum ffmpeg version 4.4 according to the version table below @@ -171,6 +174,8 @@ namespace MediaBrowser.MediaEncoding.Encoder private readonly string _encoderPath; + private readonly Version _minFFmpegMultiThreadedCli = new Version(7, 0); + public EncoderValidator(ILogger logger, string encoderPath) { _logger = logger; @@ -480,7 +485,7 @@ namespace MediaBrowser.MediaEncoding.Encoder return false; } - public bool CheckSupportedRuntimeKey(string keyDesc) + public bool CheckSupportedRuntimeKey(string keyDesc, Version? ffmpegVersion) { if (string.IsNullOrEmpty(keyDesc)) { @@ -490,7 +495,9 @@ namespace MediaBrowser.MediaEncoding.Encoder string output; try { - output = GetProcessOutput(_encoderPath, "-hide_banner -f lavfi -i nullsrc=s=1x1:d=500 -f null -", true, "?"); + // With multi-threaded cli support, FFmpeg 7 is less sensitive to keyboard input + var duration = ffmpegVersion >= _minFFmpegMultiThreadedCli ? 10000 : 1000; + output = GetProcessOutput(_encoderPath, $"-hide_banner -f lavfi -i nullsrc=s=1x1:d={duration} -f null -", true, "?"); } catch (Exception ex) { |
