Backport pull request #17883 from jellyfin/release-12.z

Fix trickplay using the wrong video stream

Original-merge: 31f0533191

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
crobibero authored and Cody Robibero committed 2026-09-15 11:15:47 -04:00
1 parent 006ecadbe0
commit 51abf6f503
1 file changed
+9
@@ -922,6 +922,15 @@ namespace MediaBrowser.MediaEncoding.Encoder
inputArg = "-hwaccel_flags +low_priority " + inputArg;
}
// Force the video stream, otherwise ffmpeg may pick a cover image.
var streamIndex = EncodingHelper.FindIndex(mediaSource.MediaStreams, imageStream);
if (streamIndex < 0)
{
throw new InvalidOperationException($"Unable to locate requested stream {imageStream.Title}");
}
inputArg += " -map 0:" + streamIndex;
var filterParam = encodingHelper.GetVideoProcessingFilterParam(jobState, options, vidEncoder).Trim();
if (string.IsNullOrWhiteSpace(filterParam))
{