Browse Source

fix graphics engine with scaling behavior crop (#2398)

pull/2399/head
Jason Dove 4 months ago committed by GitHub
parent
commit
044c8b7ad3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 4
      ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs
  3. 4
      ErsatzTV.FFmpeg/Pipeline/PipelineBuilderBase.cs

1
CHANGELOG.md

@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix scaling anamorphic content in locales that don't use period as a decimal separator (e.g. `,`)
- Block schedules: fix playout build crash when empty collection uses random playback order
- Fix watermarks and graphics elements on primary content split by mid-roll filler
- Fix watermarks and graphics elements when `Scaling Behavior` is `Crop`
### Changed
- **BREAKING CHANGE**: change how `Scripted Schedule` system works

4
ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs

@ -490,11 +490,13 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService @@ -490,11 +490,13 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
{
graphicsEngineInput = new GraphicsEngineInput();
FrameSize targetSize = await desiredState.CroppedSize.IfNoneAsync(desiredState.ScaledSize);
graphicsEngineContext = new GraphicsEngineContext(
channel.Number,
audioVersion.MediaItem,
graphicsElementContexts,
new Resolution { Width = desiredState.ScaledSize.Width, Height = desiredState.ScaledSize.Height },
new Resolution { Width = targetSize.Width, Height = targetSize.Height },
channel.FFmpegProfile.Resolution,
await playbackSettings.FrameRate.IfNoneAsync(24),
channelStartTime,

4
ErsatzTV.FFmpeg/Pipeline/PipelineBuilderBase.cs

@ -214,8 +214,10 @@ public abstract class PipelineBuilderBase : IPipelineBuilder @@ -214,8 +214,10 @@ public abstract class PipelineBuilderBase : IPipelineBuilder
foreach (GraphicsEngineInput graphicsEngineInput in _graphicsEngineInput)
{
var targetSize = desiredState.CroppedSize.IfNone(desiredState.PaddedSize);
graphicsEngineInput.AddOption(
new RawVideoInputOption(PixelFormat.BGRA, desiredState.PaddedSize, desiredState.FrameRate.IfNone(24)));
new RawVideoInputOption(PixelFormat.BGRA, targetSize, desiredState.FrameRate.IfNone(24)));
}
Debug.Assert(_videoInputFile.IsSome, "Pipeline builder requires exactly one video input file");

Loading…
Cancel
Save