|
|
|
@ -18,6 +18,7 @@ namespace ErsatzTV.Core.FFmpeg
@@ -18,6 +18,7 @@ namespace ErsatzTV.Core.FFmpeg
|
|
|
|
|
private string _inputCodec; |
|
|
|
|
private bool _normalizeLoudness; |
|
|
|
|
private Option<IDisplaySize> _padToSize = None; |
|
|
|
|
private bool _realtime; |
|
|
|
|
private Option<IDisplaySize> _scaleToSize = None; |
|
|
|
|
|
|
|
|
|
public FFmpegComplexFilterBuilder WithHardwareAcceleration(HardwareAccelerationKind hardwareAccelerationKind) |
|
|
|
@ -26,6 +27,12 @@ namespace ErsatzTV.Core.FFmpeg
@@ -26,6 +27,12 @@ namespace ErsatzTV.Core.FFmpeg
|
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public FFmpegComplexFilterBuilder WithRealtime(bool realtime) |
|
|
|
|
{ |
|
|
|
|
_realtime = realtime; |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public FFmpegComplexFilterBuilder WithScaling(IDisplaySize scaleToSize) |
|
|
|
|
{ |
|
|
|
|
_scaleToSize = Some(scaleToSize); |
|
|
|
@ -95,6 +102,11 @@ namespace ErsatzTV.Core.FFmpeg
@@ -95,6 +102,11 @@ namespace ErsatzTV.Core.FFmpeg
|
|
|
|
|
_audioDuration.IfSome( |
|
|
|
|
audioDuration => audioFilterQueue.Add($"apad=whole_dur={audioDuration.TotalMilliseconds}ms")); |
|
|
|
|
|
|
|
|
|
if (_realtime) |
|
|
|
|
{ |
|
|
|
|
videoFilterQueue.Add("realtime"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool usesHardwareFilters = acceleration != HardwareAccelerationKind.None && !isHardwareDecode && |
|
|
|
|
(_deinterlace || _scaleToSize.IsSome); |
|
|
|
|
if (usesHardwareFilters) |
|
|
|
|