Interface IEncoderContext
Represents the context for encoding operations, including codec information and encoding settings. This interface manages encoding state and allows querying and setting options for the encoder.
Inherited Members
Namespace: FFmpeg.Codecs
Assembly: FFmpeg.dll
Syntax
public interface IEncoderContext : IDisposable, IOptionQueryable
Properties
View SourceBitRate
Gets or sets the average bit rate for encoding.
The bit rate controls the amount of data processed per second during encoding. This must be set by the user unless a constant quantizer encoding mode is being used.
Declaration
long BitRate { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
Codec
Gets the codec that is used for encoding.
Declaration
Codec Codec { get; }
Property Value
| Type | Description |
|---|---|
| Codec |
CodecID
Gets the specific codec identifier, which uniquely identifies the codec being used.
Declaration
CodecID CodecID { get; }
Property Value
| Type | Description |
|---|---|
| CodecID |
CodecTag
Gets or sets the FourCC (four-character code) tag for the codec.
<p>
The codec tag is used to identify the codec in a container file.
For encoding, this is set by the user. If not set, the default based on <xref href="FFmpeg.Codecs.IEncoderContext.CodecID" data-throw-if-not-resolved="false"></xref> will be used.
</p>
<p>
The FourCC tag is stored with the least significant byte (LSB) first, so the string "ABCD" is represented as
<pre><code class="lang-csharp">('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'</code></pre>
.
Declaration
FourCC CodecTag { get; set; }
Property Value
| Type | Description |
|---|---|
| FourCC |
CodecType
Gets the type of media (video, audio, etc.) handled by the codec.
Declaration
MediaType CodecType { get; }
Property Value
| Type | Description |
|---|---|
| MediaType |
Flags
Gets or sets the codec flags, which provide additional control over codec behavior.
These flags can adjust how the encoder behaves during the encoding process.
Declaration
CodecFlags Flags { get; set; }
Property Value
| Type | Description |
|---|---|
| CodecFlags |
TimeBase
Gets or sets the time base, which is the fundamental unit of time (in seconds) for frame timestamps.
For fixed-frame-rate content, the time base should be set to 1/framerate, and timestamp increments should be exactly 1. This often represents the inverse of the frame rate for video codecs.
The time base must be set by the user during encoding.
Declaration
Rational TimeBase { get; set; }
Property Value
| Type | Description |
|---|---|
| Rational |