Browse Source

fix fallback filler (#1265)

pull/1266/head
Jason Dove 3 years ago committed by GitHub
parent
commit
b0333e89cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      CHANGELOG.md
  2. 9
      ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs
  3. 2
      ErsatzTV.FFmpeg/Option/InfiniteLoopInputOption.cs
  4. 18
      ErsatzTV.FFmpeg/Pipeline/PipelineBuilderBase.cs

3
CHANGELOG.md

@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -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

9
ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs

@ -225,7 +225,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService @@ -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 @@ -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 @@ -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,

2
ErsatzTV.FFmpeg/Option/InfiniteLoopInputOption.cs

@ -32,7 +32,7 @@ public class InfiniteLoopInputOption : IInputOption @@ -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;
}

18
ErsatzTV.FFmpeg/Pipeline/PipelineBuilderBase.cs

@ -539,15 +539,19 @@ public abstract class PipelineBuilderBase : IPipelineBuilder @@ -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));
}
}

Loading…
Cancel
Save