adjust priority in outputSizeParam cutter

This commit is contained in:
Nyanmisaka 2020-07-28 17:07:10 +08:00 committed by GitHub
parent b207907e1b
commit 2139e9f8d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1606,20 +1606,31 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
outputSizeParam = GetOutputSizeParam(state, options, outputVideoCodec).TrimEnd('"'); outputSizeParam = GetOutputSizeParam(state, options, outputVideoCodec).TrimEnd('"');
var index = outputSizeParam.IndexOf("hwdownload", StringComparison.OrdinalIgnoreCase); // hwupload=extra_hw_frames=64,vpp_qsv (for overlay_qsv on linux)
var index = outputSizeParam.IndexOf("hwupload=extra_hw_frames", StringComparison.OrdinalIgnoreCase);
if (index != -1) if (index != -1)
{ {
outputSizeParam = outputSizeParam.Slice(index); outputSizeParam = outputSizeParam.Slice(index);
} }
else else
{ {
index = outputSizeParam.IndexOf("hwupload=extra_hw_frames", StringComparison.OrdinalIgnoreCase); // vpp_qsv
index = outputSizeParam.IndexOf("vpp", StringComparison.OrdinalIgnoreCase);
if (index != -1) if (index != -1)
{ {
outputSizeParam = outputSizeParam.Slice(index); outputSizeParam = outputSizeParam.Slice(index);
} }
else else
{ {
// hwdownload,format=p010le (hardware decode + software encode for vaapi)
index = outputSizeParam.IndexOf("hwdownload", StringComparison.OrdinalIgnoreCase);
if (index != -1)
{
outputSizeParam = outputSizeParam.Slice(index);
}
else
{
// format=nv12|vaapi,hwupload,scale_vaapi
index = outputSizeParam.IndexOf("format", StringComparison.OrdinalIgnoreCase); index = outputSizeParam.IndexOf("format", StringComparison.OrdinalIgnoreCase);
if (index != -1) if (index != -1)
{ {
@ -1627,6 +1638,7 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
else else
{ {
// yadif,scale=expr
index = outputSizeParam.IndexOf("yadif", StringComparison.OrdinalIgnoreCase); index = outputSizeParam.IndexOf("yadif", StringComparison.OrdinalIgnoreCase);
if (index != -1) if (index != -1)
{ {
@ -1634,18 +1646,12 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
else else
{ {
// scale=expr
index = outputSizeParam.IndexOf("scale", StringComparison.OrdinalIgnoreCase); index = outputSizeParam.IndexOf("scale", StringComparison.OrdinalIgnoreCase);
if (index != -1) if (index != -1)
{ {
outputSizeParam = outputSizeParam.Slice(index); outputSizeParam = outputSizeParam.Slice(index);
} }
else
{
index = outputSizeParam.IndexOf("vpp", StringComparison.OrdinalIgnoreCase);
if (index != -1)
{
outputSizeParam = outputSizeParam.Slice(index);
}
} }
} }
} }