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/).
### Fixed ### Fixed
- Fix HLS Direct playback when JWT auth is also used - 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 ## [26.5.1] - 2026-05-08
### Fixed ### Fixed

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

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

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

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

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

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

Loading…
Cancel
Save