fix fallback filler (#1265)
This commit is contained in:
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
- Fix extracting embedded text subtitles that had been incompletely extracted in the past
|
||||
- Fix fallback filler looping by forcing software mode for this content
|
||||
- Other content will still use hardware acceleration as configured
|
||||
- Hardware-accelerated fallback filler may be re-enabled in the future
|
||||
|
||||
## [0.7.8-beta] - 2023-04-29
|
||||
### Added
|
||||
|
||||
@@ -225,7 +225,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
|
||||
|
||||
string videoFormat = GetVideoFormat(playbackSettings);
|
||||
|
||||
HardwareAccelerationMode hwAccel = GetHardwareAccelerationMode(playbackSettings);
|
||||
HardwareAccelerationMode hwAccel = GetHardwareAccelerationMode(playbackSettings, fillerKind);
|
||||
|
||||
OutputFormatKind outputFormat = channel.StreamingMode == StreamingMode.HttpLiveStreamingSegmenter
|
||||
? OutputFormatKind.Hls
|
||||
@@ -386,7 +386,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
|
||||
|
||||
var videoInputFile = new VideoInputFile(videoPath, new List<VideoStream> { ffmpegVideoStream });
|
||||
|
||||
HardwareAccelerationMode hwAccel = GetHardwareAccelerationMode(playbackSettings);
|
||||
HardwareAccelerationMode hwAccel = GetHardwareAccelerationMode(playbackSettings, FillerKind.None);
|
||||
|
||||
var ffmpegState = new FFmpegState(
|
||||
false,
|
||||
@@ -716,9 +716,12 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
|
||||
_ => throw new ArgumentOutOfRangeException($"unexpected video format {playbackSettings.VideoFormat}")
|
||||
};
|
||||
|
||||
private static HardwareAccelerationMode GetHardwareAccelerationMode(FFmpegPlaybackSettings playbackSettings) =>
|
||||
private static HardwareAccelerationMode GetHardwareAccelerationMode(
|
||||
FFmpegPlaybackSettings playbackSettings,
|
||||
FillerKind fillerKind) =>
|
||||
playbackSettings.HardwareAcceleration switch
|
||||
{
|
||||
_ when fillerKind == FillerKind.Fallback => HardwareAccelerationMode.None,
|
||||
HardwareAccelerationKind.Nvenc => HardwareAccelerationMode.Nvenc,
|
||||
HardwareAccelerationKind.Qsv => HardwareAccelerationMode.Qsv,
|
||||
HardwareAccelerationKind.Vaapi => HardwareAccelerationMode.Vaapi,
|
||||
|
||||
@@ -32,7 +32,7 @@ public class InfiniteLoopInputOption : IInputOption
|
||||
: Array.Empty<string>();
|
||||
|
||||
public FrameState NextState(FrameState currentState) => currentState with { Realtime = true };
|
||||
public bool AppliesTo(AudioInputFile audioInputFile) => false;
|
||||
public bool AppliesTo(AudioInputFile audioInputFile) => true;
|
||||
public bool AppliesTo(VideoInputFile videoInputFile) => true;
|
||||
public bool AppliesTo(ConcatInputFile concatInputFile) => true;
|
||||
}
|
||||
|
||||
@@ -539,15 +539,19 @@ public abstract class PipelineBuilderBase : IPipelineBuilder
|
||||
FFmpegState ffmpegState,
|
||||
FrameState desiredState)
|
||||
{
|
||||
if (desiredState.InfiniteLoop)
|
||||
if (!desiredState.InfiniteLoop)
|
||||
{
|
||||
_audioInputFile.Iter(
|
||||
a => a.AddOption(new InfiniteLoopInputOption(ffmpegState.EncoderHardwareAccelerationMode)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!videoStream.StillImage)
|
||||
{
|
||||
videoInputFile.AddOption(new InfiniteLoopInputOption(ffmpegState.EncoderHardwareAccelerationMode));
|
||||
}
|
||||
foreach (AudioInputFile audioInputFile in _audioInputFile)
|
||||
{
|
||||
audioInputFile.AddOption(new InfiniteLoopInputOption(ffmpegState.EncoderHardwareAccelerationMode));
|
||||
}
|
||||
|
||||
if (!videoStream.StillImage)
|
||||
{
|
||||
videoInputFile.AddOption(new InfiniteLoopInputOption(ffmpegState.EncoderHardwareAccelerationMode));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user