@ -1,4 +1,5 @@
@@ -1,4 +1,5 @@
using ErsatzTV.FFmpeg.Environment ;
using ErsatzTV.FFmpeg.Format ;
namespace ErsatzTV.FFmpeg.Filter ;
@ -144,8 +145,13 @@ public class ComplexFilter : IPipelineStep
@@ -144,8 +145,13 @@ public class ComplexFilter : IPipelineStep
: videoLabel ;
// vaapi uses software overlay and needs to upload
// videotoolbox seems to require a hwupload for hevc
// also wait to upload videotoolbox if a subtitle overlay is coming
string uploadFilter = string . Empty ;
if ( _f fmpegState . HardwareAccelerationMode = = HardwareAccelerationMode . Vaapi )
if ( _ maybeSubtitleInputFile . Map ( s = > s . IsImageBased ) . IfNone ( false ) = = false & &
( _f fmpegState . HardwareAccelerationMode = = HardwareAccelerationMode . Vaapi | |
_f fmpegState . HardwareAccelerationMode = = HardwareAccelerationMode . VideoToolbox & &
_ currentState . VideoFormat = = VideoFormat . Hevc ) )
{
uploadFilter = new HardwareUploadFilter ( _f fmpegState ) . Filter ;
}
@ -178,6 +184,10 @@ public class ComplexFilter : IPipelineStep
@@ -178,6 +184,10 @@ public class ComplexFilter : IPipelineStep
subtitleLabel = "[st]" ;
subtitleFilterComplex + = subtitleLabel ;
}
else
{
subtitleLabel = $"[{subtitleLabel}]" ;
}
IPipelineFilterStep overlayFilter =
AvailableSubtitleOverlayFilters . ForAcceleration ( _f fmpegState . HardwareAccelerationMode ) ;
@ -190,8 +200,11 @@ public class ComplexFilter : IPipelineStep
@@ -190,8 +200,11 @@ public class ComplexFilter : IPipelineStep
: videoLabel ;
// vaapi uses software overlay and needs to upload
// videotoolbox seems to require a hwupload for hevc
string uploadFilter = string . Empty ;
if ( _f fmpegState . HardwareAccelerationMode = = HardwareAccelerationMode . Vaapi )
if ( _f fmpegState . HardwareAccelerationMode = = HardwareAccelerationMode . Vaapi
| | _f fmpegState . HardwareAccelerationMode = = HardwareAccelerationMode . VideoToolbox & &
_ currentState . VideoFormat = = VideoFormat . Hevc )
{
uploadFilter = new HardwareUploadFilter ( _f fmpegState ) . Filter ;
}