mirror of https://github.com/ErsatzTV/ErsatzTV.git
Browse Source
* update dependencies * use ffmpeg to resize images * use ffprobe to check for animated logos and watermarks * remove last use of imagesharppull/723/head
28 changed files with 357 additions and 177 deletions
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
namespace ErsatzTV.FFmpeg.Filter; |
||||
|
||||
public class ScaleImageFilter : BaseFilter |
||||
{ |
||||
private readonly FrameSize _scaledSize; |
||||
|
||||
public ScaleImageFilter(FrameSize scaledSize) |
||||
{ |
||||
_scaledSize = scaledSize; |
||||
} |
||||
|
||||
public override string Filter => $"scale={_scaledSize.Width}:{_scaledSize.Height}"; |
||||
|
||||
// public override IList<string> OutputOptions => new List<string> { "-q:v", "2" };
|
||||
|
||||
public override FrameState NextState(FrameState currentState) => currentState with |
||||
{ |
||||
ScaledSize = _scaledSize, |
||||
PaddedSize = _scaledSize, |
||||
FrameDataLocation = FrameDataLocation.Software |
||||
}; |
||||
} |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
using ErsatzTV.FFmpeg.Environment; |
||||
|
||||
namespace ErsatzTV.FFmpeg.Filter; |
||||
|
||||
public class VideoFilter : IPipelineStep |
||||
{ |
||||
private readonly IEnumerable<IPipelineFilterStep> _filterSteps; |
||||
|
||||
public VideoFilter(IEnumerable<IPipelineFilterStep> filterSteps) |
||||
{ |
||||
_filterSteps = filterSteps; |
||||
} |
||||
|
||||
private IList<string> Arguments() => |
||||
new List<string> |
||||
{ |
||||
"-vf", |
||||
string.Join(",", _filterSteps.Map(fs => fs.Filter)) |
||||
}; |
||||
|
||||
public IList<EnvironmentVariable> EnvironmentVariables => Array.Empty<EnvironmentVariable>(); |
||||
public IList<string> GlobalOptions => Array.Empty<string>(); |
||||
public IList<string> InputOptions(InputFile inputFile) => Array.Empty<string>(); |
||||
public IList<string> FilterOptions => Arguments(); |
||||
public IList<string> OutputOptions => Array.Empty<string>(); |
||||
public FrameState NextState(FrameState currentState) => currentState; |
||||
} |
@ -1,3 +1,6 @@
@@ -1,3 +1,6 @@
|
||||
namespace ErsatzTV.FFmpeg; |
||||
|
||||
public record FrameSize(int Width, int Height); |
||||
public record FrameSize(int Width, int Height) |
||||
{ |
||||
public static FrameSize Unknown = new(-1, -1); |
||||
} |
||||
|
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
namespace ErsatzTV.FFmpeg.Option; |
||||
|
||||
public class FileNameOutputOption : OutputOption |
||||
{ |
||||
private readonly string _outputFile; |
||||
|
||||
public FileNameOutputOption(string outputFile) |
||||
{ |
||||
_outputFile = outputFile; |
||||
} |
||||
|
||||
public override IList<string> OutputOptions => new List<string> { _outputFile }; |
||||
} |
Loading…
Reference in new issue