Skip to content

Commit

Permalink
Fix the diff between requested and actual resolution in RKMPP (jellyf…
Browse files Browse the repository at this point in the history
  • Loading branch information
nyanmisaka authored Sep 22, 2024
1 parent 62606e4 commit b162e92
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5574,9 +5574,8 @@ public string GetVideoTransposeDirection(EncodingJobInfo state)
var isFullAfbcPipeline = isEncoderSupportAfbc && isDrmInDrmOut && !doOclTonemap;
var swapOutputWandH = doRkVppTranspose && swapWAndH;
var outFormat = doOclTonemap ? "p010" : "nv12";
var hwScalePrefix = doRkVppTranspose ? "vpp" : "scale";
var hwScaleFilter = GetHwScaleFilter(hwScalePrefix, "rkrga", outFormat, swapOutputWandH, swpInW, swpInH, reqW, reqH, reqMaxW, reqMaxH);
var doScaling = GetHwScaleFilter(hwScalePrefix, "rkrga", string.Empty, swapOutputWandH, swpInW, swpInH, reqW, reqH, reqMaxW, reqMaxH);
var hwScaleFilter = GetHwScaleFilter("vpp", "rkrga", outFormat, swapOutputWandH, swpInW, swpInH, reqW, reqH, reqMaxW, reqMaxH);
var doScaling = GetHwScaleFilter("vpp", "rkrga", string.Empty, swapOutputWandH, swpInW, swpInH, reqW, reqH, reqMaxW, reqMaxH);

if (!hasSubs
|| doRkVppTranspose
Expand All @@ -5588,7 +5587,7 @@ public string GetVideoTransposeDirection(EncodingJobInfo state)
if (!string.IsNullOrEmpty(doScaling)
&& !IsScaleRatioSupported(inW, inH, reqW, reqH, reqMaxW, reqMaxH, 8.0f))
{
var hwScaleFilterFirstPass = $"scale_rkrga=w=iw/8:h=ih/8:format={outFormat}:afbc=1";
var hwScaleFilterFirstPass = $"scale_rkrga=w=iw/7.9:h=ih/7.9:format={outFormat}:afbc=1";
mainFilters.Add(hwScaleFilterFirstPass);
}

Expand Down Expand Up @@ -5980,19 +5979,6 @@ protected string GetHardwareVideoDecoder(EncodingJobInfo state, EncodingOptions
}
}

var whichCodec = videoStream.Codec;
if (string.Equals(whichCodec, "avc", StringComparison.OrdinalIgnoreCase))
{
whichCodec = "h264";
}
else if (string.Equals(whichCodec, "h265", StringComparison.OrdinalIgnoreCase))
{
whichCodec = "hevc";
}

// Avoid a second attempt if no hardware acceleration is being used
options.HardwareDecodingCodecs = options.HardwareDecodingCodecs.Where(c => !string.Equals(c, whichCodec, StringComparison.OrdinalIgnoreCase)).ToArray();

// leave blank so ffmpeg will decide
return null;
}
Expand Down

0 comments on commit b162e92

Please sign in to comment.