diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-06-11 18:05:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-11 18:05:07 -0400 |
| commit | e0c907cc6009408157d42531afab4c089c2e2871 (patch) | |
| tree | 069efdd6b11b3dd81e7bc6c191497114374f0577 /MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | |
| parent | 9ee58d399cde4ccec9ea10c60c1a508a353b7836 (diff) | |
| parent | e9d2fb13e06a93336b6b16d03b66d3390a762c40 (diff) | |
Merge pull request #2702 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs')
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 54a361ff7..c348ffda7 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -1604,7 +1604,7 @@ namespace MediaBrowser.Controller.MediaEncoding } // Only do this for video files due to sometimes unpredictable codec names coming from BDInfo - if (state.RunTimeTicks.HasValue && state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType)) + if (state.VideoType == VideoType.VideoFile && state.RunTimeTicks.HasValue && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType)) { foreach (var stream in state.MediaSource.MediaStreams) { @@ -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 |
