From 38c1ef1ead173800af6bffd37e9822bee3fcf36a Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Sat, 13 Dec 2025 06:39:16 -0600 Subject: [PATCH] use hardware encoding for fallback filler --- CHANGELOG.md | 2 ++ .../FFmpeg/FFmpegLibraryProcessService.cs | 21 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63ccc0acf..dbb58a04f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - No longer round framerate to nearest integer when normalizing framerate - Allow playlists to have no items included in EPG +- Use hardware encoding for fallback filler + - Fallback filler will continue to use software decoding to avoid issues looping ## [25.9.0] - 2025-11-29 ### Added diff --git a/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs b/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs index fd7d782d6..85175cac7 100644 --- a/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs +++ b/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs @@ -404,12 +404,13 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService graphicsElementContexts.AddRange(watermarks.Map(wm => new WatermarkElementContext(wm))); } - HardwareAccelerationMode hwAccel = GetHardwareAccelerationMode(playbackSettings, fillerKind); + HardwareAccelerationMode decodeHwAccel = GetHardwareAccelerationMode(playbackSettings, fillerKind); + HardwareAccelerationMode encodeHwAccel = GetHardwareAccelerationMode(playbackSettings, FillerKind.None); string videoFormat = GetVideoFormat(playbackSettings); Option maybeVideoProfile = GetVideoProfile(videoFormat, channel.FFmpegProfile.VideoProfile); Option maybeVideoPreset = GetVideoPreset( - hwAccel, + encodeHwAccel, videoFormat, channel.FFmpegProfile.VideoPreset, FFmpegLibraryHelper.MapBitDepth(channel.FFmpegProfile.BitDepth)); @@ -548,10 +549,10 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService var ffmpegState = new FFmpegState( saveReports, - hwAccel, - hwAccel, - VaapiDriverName(hwAccel, vaapiDriver), - VaapiDeviceName(hwAccel, vaapiDevice), + decodeHwAccel, + encodeHwAccel, + VaapiDriverName(encodeHwAccel, vaapiDriver), + VaapiDeviceName(encodeHwAccel, vaapiDevice), playbackSettings.StreamSeek, finish - now, channel.StreamingMode != StreamingMode.HttpLiveStreamingDirect, @@ -576,16 +577,16 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService _logger.LogDebug("FFmpeg desired state {FrameState}", desiredState); IPipelineBuilder pipelineBuilder = await _pipelineBuilderFactory.GetBuilder( - hwAccel, + encodeHwAccel, videoInputFile, audioInputFile, watermarkInputFile, subtitleInputFile, Option.None, graphicsEngineInput, - VaapiDisplayName(hwAccel, vaapiDisplay), - VaapiDriverName(hwAccel, vaapiDriver), - VaapiDeviceName(hwAccel, vaapiDevice), + VaapiDisplayName(encodeHwAccel, vaapiDisplay), + VaapiDriverName(encodeHwAccel, vaapiDriver), + VaapiDeviceName(encodeHwAccel, vaapiDevice), await customReportsFolder.IfNoneAsync(FileSystemLayout.FFmpegReportsFolder), FileSystemLayout.FontsCacheFolder, ffmpegPath);