From f90f40428f29ce44e3132653595efc02e2d6abfb Mon Sep 17 00:00:00 2001 From: gnattu Date: Tue, 7 May 2024 15:53:40 +0800 Subject: [PATCH] Fix broken hardware encoder and filter for trickplay The hardware processing pipeline never worked for trickplay, because the required encoder was not added to the validator and the software encoder is always passed to the ProcessingFilter builder, which always returns the software filter+encoder. Signed-off-by: gnattu --- MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs | 2 ++ MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index 5f0779dc7bf..ec39f159ed6 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -82,6 +82,7 @@ public partial class EncoderValidator "av1_amf", "h264_qsv", "hevc_qsv", + "mjpeg_qsv", "av1_qsv", "h264_nvenc", "hevc_nvenc", @@ -89,6 +90,7 @@ public partial class EncoderValidator "h264_vaapi", "hevc_vaapi", "av1_vaapi", + "mjpeg_vaapi", "h264_v4l2m2m", "h264_videotoolbox", "hevc_videotoolbox", diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 80767802504..39431a9fc6d 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -848,7 +848,7 @@ private async Task ExtractImageInternal(string inputPath, string contain inputArg = "-threads " + threads + " " + inputArg; // HW accel args set a different input thread count, only set if disabled } - var filterParam = encodingHelper.GetVideoProcessingFilterParam(jobState, options, jobState.OutputVideoCodec).Trim(); + var filterParam = encodingHelper.GetVideoProcessingFilterParam(jobState, options, vidEncoder).Trim(); if (string.IsNullOrWhiteSpace(filterParam)) { throw new InvalidOperationException("EncodingHelper returned empty or invalid filter parameters.");