mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
992 B
39 lines
992 B
using ErsatzTV.FFmpeg.Format; |
|
|
|
namespace ErsatzTV.FFmpeg.Encoder.Vaapi; |
|
|
|
public class EncoderHevcVaapi : EncoderBase |
|
{ |
|
private readonly RateControlMode _rateControlMode; |
|
|
|
public EncoderHevcVaapi(RateControlMode rateControlMode) => _rateControlMode = rateControlMode; |
|
|
|
public override string Name => "hevc_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"); |
|
} |
|
|
|
result.Add("-sei"); |
|
result.Add("-a53_cc"); |
|
|
|
return result.ToArray(); |
|
} |
|
} |
|
|
|
public override FrameState NextState(FrameState currentState) => currentState with |
|
{ |
|
VideoFormat = VideoFormat.Hevc |
|
// don't change the frame data location |
|
}; |
|
}
|
|
|