diff options
| author | gnattu <gnattuoc@me.com> | 2024-02-15 23:22:32 +0800 |
|---|---|---|
| committer | gnattu <gnattuoc@me.com> | 2024-02-15 23:22:32 +0800 |
| commit | cf3e3e2c3d3cb5255de6f8f261ee03ead9e1357f (patch) | |
| tree | af8a4ac6bd71f78c9efb2a81c393aab655503f29 /MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | |
| parent | c18ef13b3b9d23e486322b76a5f0b59aba9e0467 (diff) | |
fix: code style
Signed-off-by: gnattu <gnattuoc@me.com>
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs')
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 19fe9ccd7..d23eb00fe 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -2955,6 +2955,7 @@ namespace MediaBrowser.Controller.MediaEncoding { arg2 = (isSizeFixed ? ':' : '=') + arg2; } + if (string.Equals(hwScaleSuffix, "vt", StringComparison.OrdinalIgnoreCase)) { // VideoToolBox scaling filter requires different syntax @@ -5004,18 +5005,20 @@ namespace MediaBrowser.Controller.MediaEncoding var swScaleFilter = GetSwScaleFilter(state, options, vidEncoder, inW, inH, threeDFormat, reqW, reqH, reqMaxW, reqMaxH); newfilters.Add(swScaleFilter); } + // hwupload on videotoolbox encoders can automatically convert AVFrame into its CVPixelBuffer equivalent // videotoolbox will automatically convert the CVPixelBuffer to a pixel format the encoder supports, so we don't have to set a pixel format explicitly here // This will reduce CPU usage significantly on UHD videos with 10 bit colors because we bypassed the ffmpeg pixel format conversion newfilters.Add("hwupload"); if (supportsHwScale) { - var hwScaleFilter = GetHwScaleFilter("vt", "", inW, inH, reqW, reqH, reqMaxW, reqMaxH); + var hwScaleFilter = GetHwScaleFilter("vt", string.Empty, inW, inH, reqW, reqH, reqMaxW, reqMaxH); if (useHwToneMapping) { hwScaleFilter = string.IsNullOrEmpty(hwScaleFilter) ? "scale_vt=0:0:bt709:bt709:bt709" : string.Format(CultureInfo.InvariantCulture, hwScaleFilter, ":bt709:bt709:bt709"); } + newfilters.Add(hwScaleFilter); } |
