Browse Source

fix green padding with 10-bit content on i965 vaapi (#2219)

pull/2220/head
Jason Dove 3 weeks ago committed by GitHub
parent
commit
b3ac0c68a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 13
      ErsatzTV.FFmpeg/Pipeline/VaapiPipelineBuilder.cs
  3. 2
      ErsatzTV/Services/RunOnce/DatabaseMigratorService.cs

1
CHANGELOG.md

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

13
ErsatzTV.FFmpeg/Pipeline/VaapiPipelineBuilder.cs

@ -180,7 +180,7 @@ public class VaapiPipelineBuilder : SoftwarePipelineBuilder @@ -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 @@ -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);

2
ErsatzTV/Services/RunOnce/DatabaseMigratorService.cs

@ -35,7 +35,7 @@ public class DatabaseMigratorService : BackgroundService @@ -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);
}

Loading…
Cancel
Save