Merge pull request #6053 from jellyfin/cuda-fix

Fix the 'No decoder surfaces left' error on Cuda
pull/6057/head
Bond-009 4 years ago committed by GitHub
commit 9b82b37095
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -596,7 +596,8 @@ namespace MediaBrowser.Controller.MediaEncoding
&& string.Equals(encodingOptions.HardwareAccelerationType, "nvenc", StringComparison.OrdinalIgnoreCase) && string.Equals(encodingOptions.HardwareAccelerationType, "nvenc", StringComparison.OrdinalIgnoreCase)
&& isNvdecDecoder) && isNvdecDecoder)
{ {
arg.Append("-hwaccel_output_format cuda -autorotate 0 "); // Fix for 'No decoder surfaces left' error. https://trac.ffmpeg.org/ticket/7562
arg.Append("-hwaccel_output_format cuda -extra_hw_frames 3 -autorotate 0 ");
} }
if (state.IsVideoRequest if (state.IsVideoRequest
@ -1070,7 +1071,6 @@ namespace MediaBrowser.Controller.MediaEncoding
else if (string.Equals(videoEncoder, "h264_nvenc", StringComparison.OrdinalIgnoreCase) // h264 (h264_nvenc) else if (string.Equals(videoEncoder, "h264_nvenc", StringComparison.OrdinalIgnoreCase) // h264 (h264_nvenc)
|| string.Equals(videoEncoder, "hevc_nvenc", StringComparison.OrdinalIgnoreCase)) // hevc (hevc_nvenc) || string.Equals(videoEncoder, "hevc_nvenc", StringComparison.OrdinalIgnoreCase)) // hevc (hevc_nvenc)
{ {
// following preset will be deprecated in ffmpeg 4.4, use p1~p7 instead.
switch (encodingOptions.EncoderPreset) switch (encodingOptions.EncoderPreset)
{ {
case "veryslow": case "veryslow":
@ -1251,7 +1251,7 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
if (string.Equals(videoEncoder, "h264_amf", StringComparison.OrdinalIgnoreCase) if (string.Equals(videoEncoder, "h264_amf", StringComparison.OrdinalIgnoreCase)
&& profile.Contains("constrainedbaseline", StringComparison.OrdinalIgnoreCase)) && profile.Contains("baseline", StringComparison.OrdinalIgnoreCase))
{ {
profile = "constrained_baseline"; profile = "constrained_baseline";
} }

Loading…
Cancel
Save