* upgrade sdk * fix warnings in ersatztv.ffmpeg * fix warnings in ersatztv.core * fix warnings in ersatztv.infrastructure * fix warnings in ersatztv.application * disable analysis for migrations projects * fix warnings in ersatztv.scanner * fix warnings in ersatztv * upgrade project framework * update github actions and dockerfiles
37 lines
924 B
C#
37 lines
924 B
C#
using ErsatzTV.FFmpeg.Format;
|
|
|
|
namespace ErsatzTV.FFmpeg.Encoder.Vaapi;
|
|
|
|
public class EncoderH264Vaapi : EncoderBase
|
|
{
|
|
private readonly RateControlMode _rateControlMode;
|
|
|
|
public EncoderH264Vaapi(RateControlMode rateControlMode) => _rateControlMode = rateControlMode;
|
|
|
|
public override string Name => "h264_vaapi";
|
|
|
|
public override StreamKind Kind => StreamKind.Video;
|
|
|
|
public override string[] OutputOptions
|
|
{
|
|
get
|
|
{
|
|
var result = new List<string>(base.OutputOptions);
|
|
|
|
if (_rateControlMode == RateControlMode.CQP)
|
|
{
|
|
result.Add("-rc_mode");
|
|
result.Add("1");
|
|
}
|
|
|
|
return result.ToArray();
|
|
}
|
|
}
|
|
|
|
public override FrameState NextState(FrameState currentState) => currentState with
|
|
{
|
|
VideoFormat = VideoFormat.H264
|
|
// don't change the frame data location
|
|
};
|
|
}
|