mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-15 18:45:44 +00:00
35 lines
836 B
C#
35 lines
836 B
C#
namespace FFMpegCore.Arguments;
|
|
|
|
/// <summary>
|
|
/// Represents input parameter
|
|
/// </summary>
|
|
public class InputArgument : IInputArgument
|
|
{
|
|
public readonly string FilePath;
|
|
public readonly bool VerifyExists;
|
|
|
|
public InputArgument(bool verifyExists, string filePaths)
|
|
{
|
|
VerifyExists = verifyExists;
|
|
FilePath = filePaths;
|
|
}
|
|
|
|
public InputArgument(string path, bool verifyExists) : this(verifyExists, path) { }
|
|
|
|
public void Pre()
|
|
{
|
|
if (VerifyExists && !File.Exists(FilePath))
|
|
{
|
|
throw new FileNotFoundException("Input file not found", FilePath);
|
|
}
|
|
}
|
|
|
|
public Task During(CancellationToken cancellationToken = default)
|
|
{
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public void Post() { }
|
|
|
|
public string Text => $"-i \"{FilePath}\"";
|
|
}
|