Class BaseEncoder
An NVENC-based encoder.
Inheritance
Implements
Inherited Members
Namespace: FM.LiveSwitch.Nvidia
Assembly: FM.LiveSwitch.Nvidia.dll
Syntax
public abstract class BaseEncoder : VideoEncoder, IVideoInput, IMediaInput<IVideoOutput, IVideoInput, VideoFrame, VideoBuffer, VideoBufferCollection, VideoFormat>, IInput<IVideoOutput, IVideoInput, VideoFrame, VideoBuffer, VideoBufferCollection, VideoFormat>, IVideoOutput, IMediaOutput<IVideoOutput, IVideoInput, VideoFrame, VideoBuffer, VideoBufferCollection, VideoFormat>, IOutput<IVideoOutput, IVideoInput, VideoFrame, VideoBuffer, VideoBufferCollection, VideoFormat>, IVideoElement, IMediaElement, IElement
Constructors
BaseEncoder(VideoFormat, VideoFormat)
Initializes a new instance of the Encoder class.
Declaration
protected BaseEncoder(VideoFormat inputFormat, VideoFormat outputFormat)
Parameters
Type | Name | Description |
---|---|---|
VideoFormat | inputFormat | The input format. |
VideoFormat | outputFormat | The output format. |
Properties
ForceKeyFrame
Gets or sets a value indicating whether a keyframe should be forced.
Declaration
public override bool ForceKeyFrame { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
Quality
Gets or sets encoder quality by setting intensity of QP adjustment. Quality control is based on Spatial AQ mode adjustment. Spatial AQ mode adjusts the QP values based on spatial characteristics of the frame. Since the low complexity flat regions are visually more perceptible to quality differences than high complexity detailed regions, extra bits are allocated to flat regions of the frame at the cost of the regions having high spatial detail. Although spatial AQ improves the perceptible visual quality of the encoded video, the required bit redistribution results in PSNR drop in most of the cases. Therefore, during PSNR-based evaluation, this feature should be turned off. The intensity of QP adjustment can be controlled by setting NV_ENC_INITIALIZE_PARAMS::encodeconfig->rcParams.aqStrength which ranges from 1 (least aggressive) to 15 (most aggressive). If not set, strength is auto selected by driver..
Declaration
public int Quality { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Quality range from 1 to 15. |
Methods
DoDestroy()
Destroys this instance.
Declaration
protected override void DoDestroy()
Overrides
DoEncode(IntPtr, Int32, Int32, Int32, Int32)
Encode video data by using pointer either from CPU or GPU memory. EXPERIMENTAL.
Declaration
protected VideoBuffer DoEncode(IntPtr nativePointer, int width, int height, int index, int length)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | nativePointer | |
System.Int32 | width | |
System.Int32 | height | |
System.Int32 | index | |
System.Int32 | length |
Returns
Type | Description |
---|---|
VideoBuffer |
DoProcessFrame(VideoFrame, VideoBuffer)
Processes a frame.
Declaration
protected override void DoProcessFrame(VideoFrame frame, VideoBuffer inputBuffer)
Parameters
Type | Name | Description |
---|---|---|
VideoFrame | frame | The frame. |
VideoBuffer | inputBuffer | The input buffer. |