mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Lowering the VRAM usage on NVDEC decoder
This commit is contained in:
parent
0a953aca8a
commit
4239f80c81
@ -771,10 +771,6 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
|
|
||||||
args.Append(GetCudaDeviceArgs(0, CudaAlias))
|
args.Append(GetCudaDeviceArgs(0, CudaAlias))
|
||||||
.Append(GetFilterHwDeviceArgs(CudaAlias));
|
.Append(GetFilterHwDeviceArgs(CudaAlias));
|
||||||
|
|
||||||
// workaround for "No decoder surfaces left" error,
|
|
||||||
// but will increase vram usage. https://trac.ffmpeg.org/ticket/7562
|
|
||||||
args.Append(" -extra_hw_frames 3");
|
|
||||||
}
|
}
|
||||||
else if (string.Equals(optHwaccelType, "amf", StringComparison.OrdinalIgnoreCase))
|
else if (string.Equals(optHwaccelType, "amf", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
@ -4431,7 +4427,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
{
|
{
|
||||||
if (options.EnableEnhancedNvdecDecoder && isCudaSupported && isCodecAvailable)
|
if (options.EnableEnhancedNvdecDecoder && isCudaSupported && isCodecAvailable)
|
||||||
{
|
{
|
||||||
return " -hwaccel cuda" + (outputHwSurface ? " -hwaccel_output_format cuda" : string.Empty) + (isAv1 ? " -c:v av1" : string.Empty);
|
// set -threads 1 to nvdec decoder explicitly since it doesn't implement threading support.
|
||||||
|
return " -hwaccel cuda" + (outputHwSurface ? " -hwaccel_output_format cuda" : string.Empty) + " -threads 1" + (isAv1 ? " -c:v av1" : string.Empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user