mirror of https://github.com/ErsatzTV/ErsatzTV.git
Browse Source
* optionally include progress bar in generated song video * update progress bar size/location * move everything up 10% when song progress is enabled * add watermark border to song progress bar * always show accurate progress bar * lower progress bar to 90% alpha * update changelogpull/1946/head
34 changed files with 11798 additions and 39 deletions
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
namespace ErsatzTV.Core.Domain; |
||||
|
||||
public enum ChannelSongVideoMode |
||||
{ |
||||
Default = 0, |
||||
WithProgress = 1 |
||||
} |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
namespace ErsatzTV.FFmpeg.Filter; |
||||
|
||||
public class SongProgressFilter(FrameSize frameSize, Option<TimeSpan> maybeStart, Option<TimeSpan> maybeDuration) : BaseFilter |
||||
{ |
||||
public override string Filter |
||||
{ |
||||
get |
||||
{ |
||||
foreach (TimeSpan duration in maybeDuration) |
||||
{ |
||||
TimeSpan start = maybeStart.IfNone(TimeSpan.Zero); |
||||
TimeSpan finish = start + duration; |
||||
|
||||
double width = frameSize.Width * 0.9; |
||||
double height = frameSize.Height * 0.025; |
||||
double seconds = duration.TotalSeconds; |
||||
double alreadyPlayed = start.TotalSeconds / finish.TotalSeconds; |
||||
double scale = 1 - alreadyPlayed; |
||||
|
||||
var generateWhiteBar = $"color=c=white:s={width}x{height}"; |
||||
var scaleToFullWidth = $"scale=iw*{alreadyPlayed}+iw*(t/{seconds})*{scale}:ih:eval=frame"; |
||||
var overlayBar = "overlay=W*0.05:H-h-H*0.05:shortest=1:enable='gt(t,0.1)'"; |
||||
|
||||
return $"loop=-1:1[si],{generateWhiteBar},format=rgba,colorchannelmixer=aa=0.9,{scaleToFullWidth}[sbar];[si][sbar]{overlayBar}"; |
||||
} |
||||
|
||||
return string.Empty; |
||||
} |
||||
} |
||||
|
||||
public override FrameState NextState(FrameState currentState) => currentState; |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
#nullable disable |
||||
|
||||
namespace ErsatzTV.Infrastructure.MySql.Migrations |
||||
{ |
||||
/// <inheritdoc />
|
||||
public partial class Add_Channel_SongVideoMode : Migration |
||||
{ |
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<int>( |
||||
name: "SongVideoMode", |
||||
table: "Channel", |
||||
type: "int", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
} |
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropColumn( |
||||
name: "SongVideoMode", |
||||
table: "Channel"); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
#nullable disable |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
/// <inheritdoc />
|
||||
public partial class Add_Channel_SongVideoMode : Migration |
||||
{ |
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<int>( |
||||
name: "SongVideoMode", |
||||
table: "Channel", |
||||
type: "INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
} |
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropColumn( |
||||
name: "SongVideoMode", |
||||
table: "Channel"); |
||||
} |
||||
} |
||||
} |
After Width: | Height: | Size: 33 KiB |
Loading…
Reference in new issue