Browse Source

feat: convert subtitles from media servers (#2882)

dependabot/nuget/ErsatzTV/BlazorSortable-6.0.2
Jason Dove 3 weeks ago committed by GitHub
parent
commit
b1ce607cea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 20
      ErsatzTV.Application/Playouts/Commands/SyncNextPlayoutHandler.cs
  2. 22
      ErsatzTV.Core/Next/Playout.cs

20
ErsatzTV.Application/Playouts/Commands/SyncNextPlayoutHandler.cs

@ -423,6 +423,7 @@ public partial class SyncNextPlayoutHandler( @@ -423,6 +423,7 @@ public partial class SyncNextPlayoutHandler(
VerticalMarginPercent = watermarkOptions.Watermark.VerticalMarginPercent,
OpacityPercent = watermarkOptions.Watermark.Opacity,
StreamIndex = await watermarkOptions.ImageStreamIndex.IfNoneAsync(0),
WithinSourceContent = watermarkOptions.Watermark.PlaceWithinSourceContent,
};
if (watermarkOptions.Watermark.Size is WatermarkSize.Scaled)
@ -470,7 +471,8 @@ public partial class SyncNextPlayoutHandler( @@ -470,7 +471,8 @@ public partial class SyncNextPlayoutHandler(
plexPathReplacementService,
jellyfinPathReplacementService,
embyPathReplacementService,
cancellationToken);
cancellationToken,
log: false);
// check filesystem first
if (fileSystem.File.Exists(path))
@ -489,7 +491,9 @@ public partial class SyncNextPlayoutHandler( @@ -489,7 +491,9 @@ public partial class SyncNextPlayoutHandler(
return new Core.Next.Source
{
SourceType = Core.Next.SourceType.Http,
Uri = $"http://localhost:{Settings.StreamingPort}/media/plex/{mediaSourceId}/{pmf.Key}"
Uri = $"http://localhost:{Settings.StreamingPort}/media/plex/{mediaSourceId}/{pmf.Key}",
KeepAlive = false,
Reconnect = true
};
}
@ -505,7 +509,9 @@ public partial class SyncNextPlayoutHandler( @@ -505,7 +509,9 @@ public partial class SyncNextPlayoutHandler(
return new Core.Next.Source
{
SourceType = Core.Next.SourceType.Http,
Uri = $"http://localhost:{Settings.StreamingPort}/media/jellyfin/{itemId}"
Uri = $"http://localhost:{Settings.StreamingPort}/media/jellyfin/{itemId}",
KeepAlive = false,
Reconnect = true
};
}
@ -522,7 +528,9 @@ public partial class SyncNextPlayoutHandler( @@ -522,7 +528,9 @@ public partial class SyncNextPlayoutHandler(
return new Core.Next.Source
{
SourceType = Core.Next.SourceType.Http,
Uri = $"http://localhost:{Settings.StreamingPort}/media/emby/{itemId}"
Uri = $"http://localhost:{Settings.StreamingPort}/media/emby/{itemId}",
KeepAlive = false,
Reconnect = true
};
}
@ -611,10 +619,8 @@ public partial class SyncNextPlayoutHandler( @@ -611,10 +619,8 @@ public partial class SyncNextPlayoutHandler(
if (isMediaServer)
{
return [];
// closed captions are currently unsupported
//allSubtitles.RemoveAll(s => s.Codec == "eia_608");
allSubtitles.RemoveAll(s => s.Codec == "eia_608");
}
// TODO: external image subtitles

22
ErsatzTV.Core/Next/Playout.cs

@ -135,6 +135,12 @@ namespace ErsatzTV.Core.Next @@ -135,6 +135,12 @@ namespace ErsatzTV.Core.Next
[JsonProperty("headers")]
public List<string> Headers { get; set; }
/// <summary>
/// Enable persistent connections in ffmpeg. Default: false.
/// </summary>
[JsonProperty("keep_alive")]
public bool? KeepAlive { get; set; }
/// <summary>
/// Enable reconnect on failure. Default: true.
/// </summary>
@ -278,6 +284,16 @@ namespace ErsatzTV.Core.Next @@ -278,6 +284,16 @@ namespace ErsatzTV.Core.Next
[JsonProperty("width_percent")]
[JsonConverter(typeof(MinMaxValueCheckConverter))]
public double? WidthPercent { get; set; }
/// <summary>
/// When true, position margins are measured from the edges of the source content rather than
/// the padded output frame, so letterbox/pillarbox bars push the watermark inward and keep
/// it inside the visible content. When false, margins are relative to the full padded frame,
/// so a 0% margin can land inside the bars. Has no effect when the primary content fills the
/// output (crop/stretch). Omit for false.
/// </summary>
[JsonProperty("within_source_content")]
public bool? WithinSourceContent { get; set; }
}
/// <summary>
@ -327,6 +343,12 @@ namespace ErsatzTV.Core.Next @@ -327,6 +343,12 @@ namespace ErsatzTV.Core.Next
[JsonProperty("headers")]
public List<string> Headers { get; set; }
/// <summary>
/// Enable persistent connections in ffmpeg. Default: false.
/// </summary>
[JsonProperty("keep_alive")]
public bool? KeepAlive { get; set; }
/// <summary>
/// Enable reconnect on failure. Default: true.
/// </summary>

Loading…
Cancel
Save