mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Support for crf
This commit is contained in:
parent
7c39c84c01
commit
170aefeb32
1 changed files with 41 additions and 0 deletions
|
@ -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} ";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue