Browse Source

add more watermark locations (#419)

pull/420/head
Jason Dove 4 years ago committed by GitHub
parent
commit
992121f308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 6
      ErsatzTV.Core/Domain/ChannelWatermark.cs
  3. 4
      ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs
  4. 6
      ErsatzTV/Pages/WatermarkEditor.razor

1
CHANGELOG.md

@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `Work-Ahead HLS Segmenter Limit` - the number of segmenters (channels) that will work-ahead simultaneously (if multiple channels are being watched)
- "working ahead" means transcoding at full speed, which can take a lot of resources
- This setting must be greater than or equal to 0
- Add more watermark locations ("middle" of each side)
### Changed
- Upgrade ffmpeg from 4.3 to 4.4 in all docker images

6
ErsatzTV.Core/Domain/ChannelWatermark.cs

@ -22,7 +22,11 @@ @@ -22,7 +22,11 @@
BottomRight = 0,
BottomLeft = 1,
TopRight = 2,
TopLeft = 3
TopLeft = 3,
TopMiddle = 4,
RightMiddle = 5,
BottomMiddle = 6,
LeftMiddle = 7
}
public enum ChannelWatermarkSize

4
ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs

@ -206,6 +206,10 @@ namespace ErsatzTV.Core.FFmpeg @@ -206,6 +206,10 @@ namespace ErsatzTV.Core.FFmpeg
ChannelWatermarkLocation.BottomLeft => $"x={horizontalMargin}:y=H-h-{verticalMargin}",
ChannelWatermarkLocation.TopLeft => $"x={horizontalMargin}:y={verticalMargin}",
ChannelWatermarkLocation.TopRight => $"x=W-w-{horizontalMargin}:y={verticalMargin}",
ChannelWatermarkLocation.TopMiddle => $"x=(W-w)/2:y={verticalMargin}",
ChannelWatermarkLocation.RightMiddle => $"x=W-w-{horizontalMargin}:y=(H-h)/2",
ChannelWatermarkLocation.BottomMiddle => $"x=(W-w)/2:y=H-h-{verticalMargin}",
ChannelWatermarkLocation.LeftMiddle => $"x={horizontalMargin}:y=(H-h)/2",
_ => $"x=W-w-{horizontalMargin}:y=H-h-{verticalMargin}"
};

6
ErsatzTV/Pages/WatermarkEditor.razor

@ -56,9 +56,13 @@ @@ -56,9 +56,13 @@
For="@(() => _model.Location)"
Disabled="@(_model.Mode == ChannelWatermarkMode.None)">
<MudSelectItem Value="@(ChannelWatermarkLocation.BottomRight)">Bottom Right</MudSelectItem>
<MudSelectItem Value="@(ChannelWatermarkLocation.BottomMiddle)">Bottom Middle</MudSelectItem>
<MudSelectItem Value="@(ChannelWatermarkLocation.BottomLeft)">Bottom Left</MudSelectItem>
<MudSelectItem Value="@(ChannelWatermarkLocation.TopRight)">Top Right</MudSelectItem>
<MudSelectItem Value="@(ChannelWatermarkLocation.LeftMiddle)">Left Middle</MudSelectItem>
<MudSelectItem Value="@(ChannelWatermarkLocation.TopLeft)">Top Left</MudSelectItem>
<MudSelectItem Value="@(ChannelWatermarkLocation.TopMiddle)">Top Middle</MudSelectItem>
<MudSelectItem Value="@(ChannelWatermarkLocation.TopRight)">Top Right</MudSelectItem>
<MudSelectItem Value="@(ChannelWatermarkLocation.RightMiddle)">Right Middle</MudSelectItem>
</MudSelect>
<MudGrid Class="mt-3" Style="align-items: start" Justify="Justify.Center">
<MudItem xs="6">

Loading…
Cancel
Save