diff --git a/CHANGELOG.md b/CHANGELOG.md index 8341ad2ff..7deef8900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add `MediaItem_Resolution` template data (the current `Resolution` variable is the FFmpeg Profile resolution) - Add `MediaItem_Start` template data (DateTimeOffset) - Add `MediaItem_Stop` template data (DateTimeOffset) + - Add `ScaledResolution` (the final size of the frame before padding) + - Add `place_within_source_content` (true/false) field to image graphics element - Classic schedules: add collection type `Search Query` - This allows defining search queries directly on schedule items without creating smart collections beforehand - As an example, this can be used to filter or combine existing smart collections diff --git a/ErsatzTV.Core/Graphics/ImageGraphicsElement.cs b/ErsatzTV.Core/Graphics/ImageGraphicsElement.cs index fbf170ea7..9c1339406 100644 --- a/ErsatzTV.Core/Graphics/ImageGraphicsElement.cs +++ b/ErsatzTV.Core/Graphics/ImageGraphicsElement.cs @@ -34,4 +34,7 @@ public class ImageGraphicsElement [YamlMember(Alias = "scale_width_percent", ApplyNamingConventions = false)] public double? ScaleWidthPercent { get; set; } + + [YamlMember(Alias = "place_within_source_content", ApplyNamingConventions = false)] + public bool PlaceWithinSourceContent { get; set; } } diff --git a/ErsatzTV.Core/Metadata/FFmpegProfileTemplateDataKey.cs b/ErsatzTV.Core/Metadata/FFmpegProfileTemplateDataKey.cs index 5f6815c8c..90ae45f97 100644 --- a/ErsatzTV.Core/Metadata/FFmpegProfileTemplateDataKey.cs +++ b/ErsatzTV.Core/Metadata/FFmpegProfileTemplateDataKey.cs @@ -3,4 +3,5 @@ namespace ErsatzTV.Core.Metadata; public static class FFmpegProfileTemplateDataKey { public static readonly string Resolution = "Resolution"; + public static readonly string ScaledResolution = "ScaledResolution"; } diff --git a/ErsatzTV.Infrastructure/Streaming/Graphics/GraphicsElementLoader.cs b/ErsatzTV.Infrastructure/Streaming/Graphics/GraphicsElementLoader.cs index ffeea0d4b..fbf856af2 100644 --- a/ErsatzTV.Infrastructure/Streaming/Graphics/GraphicsElementLoader.cs +++ b/ErsatzTV.Infrastructure/Streaming/Graphics/GraphicsElementLoader.cs @@ -176,6 +176,7 @@ public partial class GraphicsElementLoader( var result = new Dictionary { [FFmpegProfileTemplateDataKey.Resolution] = context.FrameSize, + [FFmpegProfileTemplateDataKey.ScaledResolution] = context.SquarePixelFrameSize, [MediaItemTemplateDataKey.StreamSeek] = context.Seek, [MediaItemTemplateDataKey.Start] = context.ContentStartTime, [MediaItemTemplateDataKey.Stop] = context.ContentStartTime + context.Duration diff --git a/ErsatzTV.Infrastructure/Streaming/Graphics/Image/ImageElement.cs b/ErsatzTV.Infrastructure/Streaming/Graphics/Image/ImageElement.cs index 3514ac06b..235d79054 100644 --- a/ErsatzTV.Infrastructure/Streaming/Graphics/Image/ImageElement.cs +++ b/ErsatzTV.Infrastructure/Streaming/Graphics/Image/ImageElement.cs @@ -42,7 +42,7 @@ public class ImageElement(ImageGraphicsElement imageGraphicsElement, ILogger log imageGraphicsElement.ScaleWidthPercent, imageGraphicsElement.HorizontalMarginPercent, imageGraphicsElement.VerticalMarginPercent, - false, + imageGraphicsElement.PlaceWithinSourceContent, cancellationToken); } catch (Exception ex)