diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e3f435f..bae48980 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - YAML playout: fix `pad_to_next` always running over time - Fix playback with text subtitles when seeking into content, i.e. when first joining a channel - Fix playback with `.ass` and `.ssa` text subtitles +- Fix green padding with 10-bit source content and i965 VAAPI driver ### Changed - Always tell ffmpeg to stop encoding with a specific duration diff --git a/ErsatzTV.FFmpeg/Pipeline/VaapiPipelineBuilder.cs b/ErsatzTV.FFmpeg/Pipeline/VaapiPipelineBuilder.cs index 99870f74..64e3fce2 100644 --- a/ErsatzTV.FFmpeg/Pipeline/VaapiPipelineBuilder.cs +++ b/ErsatzTV.FFmpeg/Pipeline/VaapiPipelineBuilder.cs @@ -180,7 +180,7 @@ public class VaapiPipelineBuilder : SoftwarePipelineBuilder bool isHdrTonemap = videoStream.ColorParams.IsHdr; currentState = SetTonemap(videoInputFile, videoStream, ffmpegState, desiredState, currentState); - currentState = SetPad(videoInputFile, desiredState, currentState, isHdrTonemap); + currentState = SetPad(videoInputFile, ffmpegState, desiredState, currentState, isHdrTonemap); // _logger.LogDebug("After pad: {PixelFormat}", currentState.PixelFormat); currentState = SetCrop(videoInputFile, desiredState, currentState); @@ -532,14 +532,21 @@ public class VaapiPipelineBuilder : SoftwarePipelineBuilder private static FrameState SetPad( VideoInputFile videoInputFile, + FFmpegState ffmpegState, FrameState desiredState, FrameState currentState, bool isHdrTonemap) { if (desiredState.CroppedSize.IsNone && currentState.PaddedSize != desiredState.PaddedSize) { - // pad_vaapi seems to pad with green when input is HDR, so use software pad here - if (isHdrTonemap) + // pad_vaapi seems to pad with green when input is HDR + // also green with 10-bit content and i965 + // so use software pad in these cases + bool is10Bit965 = currentState.BitDepth == 10 && ffmpegState.VaapiDriver + .IfNone(string.Empty) + .Contains("i965", StringComparison.OrdinalIgnoreCase); + + if (isHdrTonemap || is10Bit965) { var padStep = new PadFilter(currentState, desiredState.PaddedSize); currentState = padStep.NextState(currentState); diff --git a/ErsatzTV/Services/RunOnce/DatabaseMigratorService.cs b/ErsatzTV/Services/RunOnce/DatabaseMigratorService.cs index 96816770..49cd9f72 100644 --- a/ErsatzTV/Services/RunOnce/DatabaseMigratorService.cs +++ b/ErsatzTV/Services/RunOnce/DatabaseMigratorService.cs @@ -35,7 +35,7 @@ public class DatabaseMigratorService : BackgroundService .GetPendingMigrationsAsync(stoppingToken) .Map(l => l.ToList()); - if (pendingMigrations.Contains("Add_MediaFilePathHash", StringComparer.OrdinalIgnoreCase)) + if (pendingMigrations.Any(m => m.Contains("Add_MediaFilePathHash", StringComparison.OrdinalIgnoreCase))) { await dbContext.Database.MigrateAsync("Add_MediaFilePathHash", stoppingToken); }