Class VideoEncoder
A video encoder.
Inheritance
Implements
Inherited Members
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public abstract class VideoEncoder : VideoPipe, 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
VideoEncoder(VideoFormat, VideoFormat)
Initializes a new instance of the VideoEncoder class.
Declaration
public VideoEncoder(VideoFormat inputFormat, VideoFormat outputFormat)
Parameters
Type | Name | Description |
---|---|---|
VideoFormat | inputFormat | The input format. |
VideoFormat | outputFormat | The output format. |
Properties
Bitrate
Gets or sets the current bitrate, in kbps. A value of -1 indicates unset.
Declaration
public virtual int Bitrate { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
CanChangeBitrate
Gets whether this pipe can change the output bitrate.
Declaration
protected override bool CanChangeBitrate { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
ForceKeyFrame
Gets or sets a value indicating whether a keyframe should be forced.
Declaration
public abstract bool ForceKeyFrame { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
FrameHeight
Gets the last frame height.
Declaration
public int FrameHeight { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
FrameRate
Gets the current frame rate.
Declaration
public double FrameRate { get; }
Property Value
Type | Description |
---|---|
System.Double |
FramesEncoded
Gets the number of encoded frames.
Declaration
public long FramesEncoded { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
FrameWidth
Gets the last frame width.
Declaration
public int FrameWidth { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxBitrate
Gets or sets the maximum bitrate, in kbps. A value of -1 indicates unset (no maximum).
Declaration
public virtual int MaxBitrate { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxCodecBitrate
Gets the maximum possible codec bitrate, in kbps. A value of -1 indicates unset (no maximum).
Declaration
public virtual int MaxCodecBitrate { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxOutputBitrate
Gets or sets the maximum output bitrate, in kbps. A value of -1 indicates unset (no maximum).
Declaration
public override int MaxOutputBitrate { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
MinBitrate
Gets or sets the minimum bitrate, in kbps. A value of -1 indicates unset (no minimum).
Declaration
public virtual int MinBitrate { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MinCodecBitrate
Gets the minimum possible codec bitrate, in kbps. A value of -1 indicates unset (no minimum).
Declaration
public virtual int MinCodecBitrate { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MinOutputBitrate
Gets or sets the minimum output bitrate, in kbps. A value of -1 indicates unset (no minimum).
Declaration
public override int MinOutputBitrate { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
StaticOutputBitrate
Gets or sets whether MinOutputBitrate and MaxOutputBitrate should return MinCodecBitrate and MaxCodecBitrate, respectively, or response to changes in MinBitrate and MaxBitrate.
Declaration
public bool StaticOutputBitrate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
TargetBitrate
Gets or sets the target bitrate, in kbps. A value of -1 indicates unset (no target).
Declaration
public virtual int TargetBitrate { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
TargetOutputBitrate
Gets or sets the target output bitrate, in kbps. A value of -1 indicates unset (no target).
Declaration
public override int TargetOutputBitrate { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
Methods
DoProcessControlFrames(MediaControlFrame[])
Processes the control frames.
Declaration
protected override void DoProcessControlFrames(MediaControlFrame[] controlFrames)
Parameters
Type | Name | Description |
---|---|---|
MediaControlFrame[] | controlFrames | The control frames. |
Overrides
DoProcessTrackStatsFromOutput(MediaTrackStats)
Processes track stats from an output.
Declaration
protected override void DoProcessTrackStatsFromOutput(MediaTrackStats trackStats)
Parameters
Type | Name | Description |
---|---|---|
MediaTrackStats | trackStats | The track stats. |
Overrides
ProcessFrame(VideoFrame)
Processes the frame.
Declaration
public override bool ProcessFrame(VideoFrame frame)
Parameters
Type | Name | Description |
---|---|---|
VideoFrame | frame | The frame. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
RaiseFrame(VideoFrame)
Raises the frame.
Declaration
protected override void RaiseFrame(VideoFrame frame)
Parameters
Type | Name | Description |
---|---|---|
VideoFrame | frame | The frame. |
Overrides
Events
OnBitrateChange
Raised when the bitrate changes.
Declaration
public event Action0 OnBitrateChange
Event Type
Type | Description |
---|---|
Action0 |