Browse Source

graphics engine: add scaled resolution and place within source content (#2606)

pull/2608/head
Jason Dove 2 months ago committed by GitHub
parent
commit
e6824cf251
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 3
      ErsatzTV.Core/Graphics/ImageGraphicsElement.cs
  3. 1
      ErsatzTV.Core/Metadata/FFmpegProfileTemplateDataKey.cs
  4. 1
      ErsatzTV.Infrastructure/Streaming/Graphics/GraphicsElementLoader.cs
  5. 2
      ErsatzTV.Infrastructure/Streaming/Graphics/Image/ImageElement.cs

2
CHANGELOG.md

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

3
ErsatzTV.Core/Graphics/ImageGraphicsElement.cs

@ -34,4 +34,7 @@ public class ImageGraphicsElement @@ -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; }
}

1
ErsatzTV.Core/Metadata/FFmpegProfileTemplateDataKey.cs

@ -3,4 +3,5 @@ namespace ErsatzTV.Core.Metadata; @@ -3,4 +3,5 @@ namespace ErsatzTV.Core.Metadata;
public static class FFmpegProfileTemplateDataKey
{
public static readonly string Resolution = "Resolution";
public static readonly string ScaledResolution = "ScaledResolution";
}

1
ErsatzTV.Infrastructure/Streaming/Graphics/GraphicsElementLoader.cs

@ -176,6 +176,7 @@ public partial class GraphicsElementLoader( @@ -176,6 +176,7 @@ public partial class GraphicsElementLoader(
var result = new Dictionary<string, object>
{
[FFmpegProfileTemplateDataKey.Resolution] = context.FrameSize,
[FFmpegProfileTemplateDataKey.ScaledResolution] = context.SquarePixelFrameSize,
[MediaItemTemplateDataKey.StreamSeek] = context.Seek,
[MediaItemTemplateDataKey.Start] = context.ContentStartTime,
[MediaItemTemplateDataKey.Stop] = context.ContentStartTime + context.Duration

2
ErsatzTV.Infrastructure/Streaming/Graphics/Image/ImageElement.cs

@ -42,7 +42,7 @@ public class ImageElement(ImageGraphicsElement imageGraphicsElement, ILogger log @@ -42,7 +42,7 @@ public class ImageElement(ImageGraphicsElement imageGraphicsElement, ILogger log
imageGraphicsElement.ScaleWidthPercent,
imageGraphicsElement.HorizontalMarginPercent,
imageGraphicsElement.VerticalMarginPercent,
false,
imageGraphicsElement.PlaceWithinSourceContent,
cancellationToken);
}
catch (Exception ex)

Loading…
Cancel
Save