diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-06-12 02:11:19 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-06-12 02:11:19 -0400 |
| commit | ceed0241fd1db8b417e4148f2599368779ba8b14 (patch) | |
| tree | 4b0c17f4e87d5a56df6f9b230ae414f52f29b268 /MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | |
| parent | 06967d540fd0ea3cbf293de6f6dff41daf1d0fe6 (diff) | |
fixes #2578 - [VAAPI Bug] HEVC Decoding not possible on Intel hardware without this ability
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs')
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index c348ffda7..c14b1f416 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -42,6 +42,11 @@ namespace MediaBrowser.Controller.MediaEncoding { var hwType = encodingOptions.HardwareAccelerationType; + if (!encodingOptions.EnableHardwareEncoding) + { + hwType = null; + } + if (string.Equals(hwType, "qsv", StringComparison.OrdinalIgnoreCase) || string.Equals(hwType, "h264_qsv", StringComparison.OrdinalIgnoreCase)) { @@ -1761,14 +1766,11 @@ namespace MediaBrowser.Controller.MediaEncoding return null; } - if (state.VideoStream != null && !string.IsNullOrWhiteSpace(state.VideoStream.Codec)) + if (state.VideoStream != null && + !string.IsNullOrWhiteSpace(state.VideoStream.Codec) && + !string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType) && + encodingOptions.EnableHardwareDecoding) { - if (!string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType)) - { - // causing unpredictable results - //return "-hwaccel auto"; - } - if (string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase)) { switch (state.MediaSource.VideoStream.Codec.ToLower()) @@ -1818,6 +1820,13 @@ namespace MediaBrowser.Controller.MediaEncoding return "-c:v h264_cuvid "; } break; + case "hevc": + case "h265": + if (_mediaEncoder.SupportsDecoder("hevc_cuvid")) + { + return "-c:v hevc_cuvid "; + } + break; } } } |
