Merge pull request #12384 from evanjarrett/qsv-renderdevice

Update QSV device args  to use the renderNodePath
pull/12578/head
Bond-009 7 months ago committed by GitHub
commit 737a1b8a37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -878,17 +878,23 @@ namespace MediaBrowser.Controller.MediaEncoding
renderNodePath);
}
private string GetQsvDeviceArgs(string alias)
private string GetQsvDeviceArgs(string renderNodePath, string alias)
{
var arg = " -init_hw_device qsv=" + (alias ?? QsvAlias);
if (OperatingSystem.IsLinux())
{
// derive qsv from vaapi device
return GetVaapiDeviceArgs(null, "iHD", "i915", null, VaapiAlias) + arg + "@" + VaapiAlias;
return GetVaapiDeviceArgs(renderNodePath, "iHD", "i915", null, VaapiAlias) + arg + "@" + VaapiAlias;
}
if (OperatingSystem.IsWindows())
{
// on Windows, the deviceIndex is an int
if (int.TryParse(renderNodePath, NumberStyles.Integer, CultureInfo.InvariantCulture, out int deviceIndex))
{
return GetD3d11vaDeviceArgs(deviceIndex, string.Empty, D3d11vaAlias) + arg + "@" + D3d11vaAlias;
}
// derive qsv from d3d11va device
return GetD3d11vaDeviceArgs(0, "0x8086", D3d11vaAlias) + arg + "@" + D3d11vaAlias;
}
@ -1048,7 +1054,7 @@ namespace MediaBrowser.Controller.MediaEncoding
return string.Empty;
}
args.Append(GetQsvDeviceArgs(QsvAlias));
args.Append(GetQsvDeviceArgs(options.QsvDevice, QsvAlias));
var filterDevArgs = GetFilterHwDeviceArgs(QsvAlias);
// child device used by qsv.
if (_mediaEncoder.SupportsHwaccel("vaapi") || _mediaEncoder.SupportsHwaccel("d3d11va"))

@ -26,6 +26,7 @@ public class EncodingOptions
// This is a DRM device that is almost guaranteed to be there on every intel platform,
// plus it's the default one in ffmpeg if you don't specify anything
VaapiDevice = "/dev/dri/renderD128";
QsvDevice = string.Empty;
EnableTonemapping = false;
EnableVppTonemapping = false;
EnableVideoToolboxTonemapping = false;
@ -136,6 +137,11 @@ public class EncodingOptions
/// </summary>
public string VaapiDevice { get; set; }
/// <summary>
/// Gets or sets the QSV device.
/// </summary>
public string QsvDevice { get; set; }
/// <summary>
/// Gets or sets a value indicating whether tonemapping is enabled.
/// </summary>

Loading…
Cancel
Save