vaapi cqp rate control mode (#1319)

This commit is contained in:
Jason Dove
2023-06-22 11:42:11 -05:00
committed by GitHub
parent 015f5e9798
commit 52e1874426
16 changed files with 469 additions and 34 deletions
@@ -4,8 +4,29 @@ namespace ErsatzTV.FFmpeg.Encoder.Vaapi;
public class EncoderMpeg2Vaapi : EncoderBase
{
private readonly RateControlMode _rateControlMode;
public EncoderMpeg2Vaapi(RateControlMode rateControlMode) => _rateControlMode = rateControlMode;
public override string Name => "mpeg2_vaapi";
public override StreamKind Kind => StreamKind.Video;
public override IList<string> OutputOptions
{
get
{
IList<string> result = base.OutputOptions;
if (_rateControlMode == RateControlMode.CQP)
{
result.Add("-rc_mode");
result.Add("1");
}
return result;
}
}
public override FrameState NextState(FrameState currentState) => currentState with
{