Support for crf

Former-commit-id: 170aefeb32
This commit is contained in:
Malte Rosenbjerg 2020-02-27 18:28:49 +01:00
parent 0cf3b6f859
commit 06a046e3fe

View file

@ -0,0 +1,41 @@
using System;
namespace FFMpegCore.FFMPEG.Argument
{
/// <summary>
/// Constant Rate Factor (CRF) argument
/// </summary>
public class ConstantRateFactorArgument : Argument<int>
{
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} ";
}
}
/// <summary>
/// Constant Rate Factor (CRF) argument
/// </summary>
public class Variable : Argument<int>
{
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} ";
}
}
}