Browse Source

fix default song background for 4:3 resolutions (#1951)

* fix default song background for 4:3 resolutions

* use 16:9 progress overlay for now
pull/1956/head
Jason Dove 8 months ago committed by GitHub
parent
commit
838c2a1661
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 4
      ErsatzTV.Application/Streaming/Queries/GetPlayoutItemProcessByChannelNumberHandler.cs
  3. 8
      ErsatzTV.Core/FFmpeg/SongVideoGenerator.cs
  4. 1
      ErsatzTV/ErsatzTV.csproj
  5. BIN
      ErsatzTV/Resources/song_progress_overlay_43.png
  6. 1
      ErsatzTV/Services/RunOnce/ResourceExtractorService.cs

2
CHANGELOG.md

@ -39,6 +39,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -39,6 +39,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix synchronizing Plex collections
- If this breaks collection sync for you, you will need to update your Plex server
- Fix guide group generation for `duration` YAML instructions
- Fix default song background when targeting 4:3 resolutions
- Previously the background was always 16:9 and was padded, now it will fill 4:3
## [0.8.8-beta] - 2024-09-19
### Added

4
ErsatzTV.Application/Streaming/Queries/GetPlayoutItemProcessByChannelNumberHandler.cs

@ -261,6 +261,8 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler< @@ -261,6 +261,8 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler<
// override watermark as song_progress_overlay.png
if (videoVersion is BackgroundImageMediaVersion { IsSongWithProgress: true })
{
string image = "song_progress_overlay.png";
disableWatermarks = false;
playoutItemWatermark = new ChannelWatermark
{
@ -272,7 +274,7 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler< @@ -272,7 +274,7 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler<
Opacity = 100,
Location = WatermarkLocation.TopLeft,
ImageSource = ChannelWatermarkImageSource.Resource,
Image = "song_progress_overlay.png"
Image = image
};
}
}

8
ErsatzTV.Core/FFmpeg/SongVideoGenerator.cs

@ -41,8 +41,8 @@ public class SongVideoGenerator : ISongVideoGenerator @@ -41,8 +41,8 @@ public class SongVideoGenerator : ISongVideoGenerator
{
Id = -1,
Chapters = [],
Width = 192,
Height = 108,
Width = channel.FFmpegProfile.Resolution.Width / 10,
Height = channel.FFmpegProfile.Resolution.Height / 10,
SampleAspectRatio = "1:1",
Streams = [new MediaStream { MediaStreamKind = MediaStreamKind.Video, Index = 0, PixelFormat = "yuv420p" }]
};
@ -173,8 +173,8 @@ public class SongVideoGenerator : ISongVideoGenerator @@ -173,8 +173,8 @@ public class SongVideoGenerator : ISongVideoGenerator
{
Chapters = [],
// always stretch cover art
Width = 192,
Height = 108,
Width = channel.FFmpegProfile.Resolution.Width / 10,
Height = channel.FFmpegProfile.Resolution.Height / 10,
SampleAspectRatio = "1:1",
Streams = new List<MediaStream>
{

1
ErsatzTV/ErsatzTV.csproj

@ -87,6 +87,7 @@ @@ -87,6 +87,7 @@
<EmbeddedResource Include="Resources\Templates\_musicVideo.sbntxt" />
<EmbeddedResource Include="Resources\Templates\_otherVideo.sbntxt" />
<EmbeddedResource Include="Resources\Templates\_song.sbntxt" />
<EmbeddedResource Include="Resources\song_progress_overlay_43.png" />
</ItemGroup>
<ItemGroup>

BIN
ErsatzTV/Resources/song_progress_overlay_43.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

1
ErsatzTV/Services/RunOnce/ResourceExtractorService.cs

@ -22,6 +22,7 @@ public class ResourceExtractorService : BackgroundService @@ -22,6 +22,7 @@ public class ResourceExtractorService : BackgroundService
await ExtractResource(assembly, "song_background_2.png", stoppingToken);
await ExtractResource(assembly, "song_background_3.png", stoppingToken);
await ExtractResource(assembly, "song_progress_overlay.png", stoppingToken);
await ExtractResource(assembly, "song_progress_overlay_43.png", stoppingToken);
await ExtractResource(assembly, "ErsatzTV.png", stoppingToken);
await ExtractFontResource(assembly, "Sen.ttf", stoppingToken);

Loading…
Cancel
Save