diff --git a/FFMpegCore/FFMPEG/Argument/Atoms/ConstantRateFactorArgument.cs b/FFMpegCore/FFMPEG/Argument/Atoms/ConstantRateFactorArgument.cs new file mode 100644 index 0000000..a753e78 --- /dev/null +++ b/FFMpegCore/FFMPEG/Argument/Atoms/ConstantRateFactorArgument.cs @@ -0,0 +1,41 @@ +using System; + +namespace FFMpegCore.FFMPEG.Argument +{ + /// + /// Constant Rate Factor (CRF) argument + /// + public class ConstantRateFactorArgument : Argument + { + public ConstantRateFactorArgument(int crf) : base(crf) + { + if (crf < 0 || crf > 63) + { + throw new ArgumentException("Argument is outside range (0 - 63)", nameof(crf)); + } + } + + public override string GetStringValue() + { + return $"-crf {Value} "; + } + } + /// + /// Constant Rate Factor (CRF) argument + /// + public class Variable : Argument + { + public ConstantRateFactorArgument(int crf) : base(crf) + { + if (crf < 0 || crf > 63) + { + throw new ArgumentException("Argument is outside range (0 - 63)", nameof(crf)); + } + } + + public override string GetStringValue() + { + return $"-crf {Value} "; + } + } +} \ No newline at end of file