mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
fixes #2578 - [VAAPI Bug] HEVC Decoding not possible on Intel hardware without this ability
This commit is contained in:
parent
06967d540f
commit
ceed0241fd
@ -42,6 +42,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
{
|
{
|
||||||
var hwType = encodingOptions.HardwareAccelerationType;
|
var hwType = encodingOptions.HardwareAccelerationType;
|
||||||
|
|
||||||
|
if (!encodingOptions.EnableHardwareEncoding)
|
||||||
|
{
|
||||||
|
hwType = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (string.Equals(hwType, "qsv", StringComparison.OrdinalIgnoreCase) ||
|
if (string.Equals(hwType, "qsv", StringComparison.OrdinalIgnoreCase) ||
|
||||||
string.Equals(hwType, "h264_qsv", StringComparison.OrdinalIgnoreCase))
|
string.Equals(hwType, "h264_qsv", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
@ -1761,14 +1766,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
return null;
|
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))
|
if (string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
switch (state.MediaSource.VideoStream.Codec.ToLower())
|
switch (state.MediaSource.VideoStream.Codec.ToLower())
|
||||||
@ -1818,6 +1820,13 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
return "-c:v h264_cuvid ";
|
return "-c:v h264_cuvid ";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "hevc":
|
||||||
|
case "h265":
|
||||||
|
if (_mediaEncoder.SupportsDecoder("hevc_cuvid"))
|
||||||
|
{
|
||||||
|
return "-c:v hevc_cuvid ";
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,8 @@ namespace MediaBrowser.Model.Configuration
|
|||||||
public string VaapiDevice { get; set; }
|
public string VaapiDevice { get; set; }
|
||||||
public int H264Crf { get; set; }
|
public int H264Crf { get; set; }
|
||||||
public string H264Preset { get; set; }
|
public string H264Preset { get; set; }
|
||||||
|
public bool EnableHardwareDecoding { get; set; }
|
||||||
|
public bool EnableHardwareEncoding { get; set; }
|
||||||
|
|
||||||
public EncodingOptions()
|
public EncodingOptions()
|
||||||
{
|
{
|
||||||
@ -22,6 +24,8 @@ namespace MediaBrowser.Model.Configuration
|
|||||||
EncodingThreadCount = -1;
|
EncodingThreadCount = -1;
|
||||||
VaapiDevice = "/dev/dri/card0";
|
VaapiDevice = "/dev/dri/card0";
|
||||||
H264Crf = 23;
|
H264Crf = 23;
|
||||||
|
EnableHardwareDecoding = true;
|
||||||
|
EnableHardwareEncoding = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user