소스 검색

enable h264_cuvid decoder

Luke Pulverenti 8 년 전
부모
커밋
2c54390c38
2개의 변경된 파일16개의 추가작업 그리고 1개의 파일을 삭제
  1. 14 0
      MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
  2. 2 1
      MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs

+ 14 - 0
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

@@ -1806,6 +1806,20 @@ namespace MediaBrowser.Controller.MediaEncoding
                             break;
                     }
                 }
+
+                else if (string.Equals(encodingOptions.HardwareAccelerationType, "nvenc", StringComparison.OrdinalIgnoreCase))
+                {
+                    switch (state.MediaSource.VideoStream.Codec.ToLower())
+                    {
+                        case "avc":
+                        case "h264":
+                            if (_mediaEncoder.SupportsDecoder("h264_cuvid"))
+                            {
+                                return "-c:v h264_cuvid ";
+                            }
+                            break;
+                    }
+                }
             }
 
             // leave blank so ffmpeg will decide

+ 2 - 1
MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs

@@ -90,7 +90,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
                 "h264_qsv",
                 "hevc_qsv",
                 "mpeg2_qsv",
-                "vc1_qsv"
+                "vc1_qsv",
+                "h264_cuvid"
             };
 
             foreach (var codec in required)