Browse Source

fix: use configured ffmpeg with all graphics elements (#2892)

pull/2893/head
Jason Dove 1 week ago committed by GitHub
parent
commit
fecce92e97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 6
      ErsatzTV.Infrastructure/Streaming/Graphics/GraphicsEngine.cs
  3. 3
      ErsatzTV.Infrastructure/Streaming/Graphics/Motion/MotionElement.cs
  4. 3
      ErsatzTV.Infrastructure/Streaming/Graphics/Subtitle/SubtitleElement.cs

2
CHANGELOG.md

@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Fix HLS Direct playback when JWT auth is also used
- Use configured ffmpeg path for motion and subtitle graphics elements
- Previously, these elements required ffmpeg to be on PATH
## [26.5.1] - 2026-05-08
### Fixed

6
ErsatzTV.Infrastructure/Streaming/Graphics/GraphicsEngine.cs

@ -27,6 +27,10 @@ public class GraphicsEngine( @@ -27,6 +27,10 @@ public class GraphicsEngine(
ConfigElementKey.FFprobePath,
cancellationToken);
Option<string> ffmpegPath = await configElementRepository.GetValue<string>(
ConfigElementKey.FFmpegPath,
cancellationToken);
var elements = new List<IGraphicsElement>();
foreach (GraphicsElementContext element in context.Elements)
{
@ -54,6 +58,7 @@ public class GraphicsEngine( @@ -54,6 +58,7 @@ public class GraphicsEngine(
new MotionElement(
motionElementDataContext.MotionElement,
ffprobePath,
ffmpegPath,
localStatisticsProvider,
logger));
break;
@ -74,6 +79,7 @@ public class GraphicsEngine( @@ -74,6 +79,7 @@ public class GraphicsEngine(
templateFunctions,
tempFilePool,
subtitleElementContext.SubtitleElement,
ffmpegPath,
variables,
logger);

3
ErsatzTV.Infrastructure/Streaming/Graphics/Motion/MotionElement.cs

@ -15,6 +15,7 @@ namespace ErsatzTV.Infrastructure.Streaming.Graphics; @@ -15,6 +15,7 @@ namespace ErsatzTV.Infrastructure.Streaming.Graphics;
public class MotionElement(
MotionGraphicsElement motionElement,
Option<string> ffprobePath,
Option<string> ffmpegPath,
ILocalStatisticsProvider localStatisticsProvider,
ILogger logger)
: GraphicsElement, IDisposable
@ -193,7 +194,7 @@ public class MotionElement( @@ -193,7 +194,7 @@ public class MotionElement(
_state = MotionElementState.PlayingIn;
Command command = Cli.Wrap("ffmpeg")
Command command = Cli.Wrap(await ffmpegPath.IfNoneAsync("ffmpeg"))
.WithArguments(arguments)
.WithWorkingDirectory(FileSystemLayout.TempFilePoolFolder)
.WithStandardOutputPipe(PipeTarget.ToStream(pipe.Writer.AsStream()));

3
ErsatzTV.Infrastructure/Streaming/Graphics/Subtitle/SubtitleElement.cs

@ -18,6 +18,7 @@ public class SubtitleElement( @@ -18,6 +18,7 @@ public class SubtitleElement(
TemplateFunctions templateFunctions,
ITempFilePool tempFilePool,
SubtitleGraphicsElement subtitleElement,
Option<string> ffmpegPath,
Dictionary<string, object> variables,
ILogger logger)
: GraphicsElement, IDisposable
@ -114,7 +115,7 @@ public class SubtitleElement( @@ -114,7 +115,7 @@ public class SubtitleElement(
"-"
];
Command command = Cli.Wrap("ffmpeg")
Command command = Cli.Wrap(await ffmpegPath.IfNoneAsync("ffmpeg"))
.WithArguments(arguments)
.WithWorkingDirectory(FileSystemLayout.TempFilePoolFolder)
.WithStandardOutputPipe(PipeTarget.ToStream(pipe.Writer.AsStream()));

Loading…
Cancel
Save