mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.0 KiB
30 lines
1.0 KiB
using System.Globalization; |
|
using ErsatzTV.FFmpeg.Environment; |
|
|
|
namespace ErsatzTV.FFmpeg.InputOption; |
|
|
|
public class ReadrateInputOption(double readRate) : IInputOption |
|
{ |
|
public EnvironmentVariable[] EnvironmentVariables => []; |
|
|
|
public string[] GlobalOptions => []; |
|
|
|
public string[] InputOptions(InputFile inputFile) => |
|
[ |
|
"-readrate", |
|
readRate.ToString("0.0####", CultureInfo.InvariantCulture) |
|
]; |
|
|
|
public string[] FilterOptions => []; |
|
public string[] OutputOptions => []; |
|
public FrameState NextState(FrameState currentState) => currentState with { Realtime = true }; |
|
|
|
public bool AppliesTo(AudioInputFile audioInputFile) => audioInputFile is not NullAudioInputFile; |
|
|
|
// don't use realtime input for a still image |
|
public bool AppliesTo(VideoInputFile videoInputFile) => videoInputFile.VideoStreams.All(s => !s.StillImage); |
|
|
|
public bool AppliesTo(ConcatInputFile concatInputFile) => true; |
|
|
|
public bool AppliesTo(GraphicsEngineInput graphicsEngineInput) => false; |
|
}
|
|
|