mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
Add option to extract keyframe only during trickplay image generation
This would be significantly faster than decoding every frame, but it does have compatibility issues. Not all decoders support this mode, notably the VP9 decoder, CUVID decoders, and QSV decoders. Some videos with very long key-frame intervals may also perform poorly with this mode, as the image timing could become too inaccurate to reflect the actual frame. Signed-off-by: gnattu <gnattuoc@me.com>
This commit is contained in:
@@ -807,6 +807,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
int? threads,
|
||||
int? qualityScale,
|
||||
ProcessPriorityClass? priority,
|
||||
bool enableKeyFrameOnlyExtraction,
|
||||
EncodingHelper encodingHelper,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -862,6 +863,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
inputArg = "-threads " + threads + " " + inputArg; // HW accel args set a different input thread count, only set if disabled
|
||||
}
|
||||
|
||||
if (enableKeyFrameOnlyExtraction)
|
||||
{
|
||||
inputArg = "-skip_frame nokey " + inputArg;
|
||||
}
|
||||
|
||||
var filterParam = encodingHelper.GetVideoProcessingFilterParam(jobState, options, vidEncoder).Trim();
|
||||
if (string.IsNullOrWhiteSpace(filterParam))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user