Show / Hide Table of Contents

Struct CodecParameters_ref

A managed wrapper around the unmanaged FFmpeg _AVCodecParameters structure, providing safe access to codec parameters.

Implements
ICodecParameters
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: FFmpeg.Codecs
Assembly: FFmpeg.dll
Syntax
public struct CodecParameters_ref : ICodecParameters

Properties

View Source

AlphaMode

Gets or sets how the alpha channel is represented in relation to the color components.

Declaration
public AlphaMode AlphaMode { get; set; }
Property Value
Type Description
AlphaMode
Remarks

Premultiplied indicates that the color components are already multiplied by the alpha value, while Straight indicates that the alpha channel is stored independently of the color components.

View Source

BitRate

Gets or sets the target bit rate in bits per second for the codec.

Declaration
public int BitRate { get; set; }
Property Value
Type Description
int
View Source

BitsPerCodedSample

Gets or sets the number of bits per coded sample.

Declaration
public int BitsPerCodedSample { get; set; }
Property Value
Type Description
int
View Source

BitsPerRawSample

Gets or sets the number of bits per raw (uncoded) sample.

Declaration
public int BitsPerRawSample { get; set; }
Property Value
Type Description
int
View Source

BlockAlign

Gets or sets the block alignment (in bytes) for audio data.

Declaration
public int BlockAlign { get; set; }
Property Value
Type Description
int
View Source

ChannelLayout

Declaration
public ChannelLayout_ref ChannelLayout { get; }
Property Value
Type Description
ChannelLayout_ref
View Source

Channels

Gets the number of audio channels for the current codec parameters.

Declaration
public int Channels { get; }
Property Value
Type Description
int
Remarks

This value indicates the number of channels in the audio stream, such as 1 for mono, 2 for stereo, or higher for surround formats. The meaning is related to the ChannelLayout property.

View Source

ChromaLocation

Gets or sets the chroma sample location for video data.

Declaration
public ChromaLocation ChromaLocation { get; set; }
Property Value
Type Description
ChromaLocation
View Source

CodecId

Gets or sets the specific codec ID used for the encoded data.

Declaration
public CodecID CodecId { get; set; }
Property Value
Type Description
CodecID
View Source

CodecTag

Gets or sets the codec tag, which is additional information about the codec (corresponding to the AVI FOURCC).

Declaration
public FourCC CodecTag { get; set; }
Property Value
Type Description
FourCC
View Source

ColorPrimaries

Gets or sets the color primaries used for color interpretation in video streams.

Declaration
public ColorPrimaries ColorPrimaries { get; set; }
Property Value
Type Description
ColorPrimaries
View Source

ColorRange

Gets or sets the color range (e.g., limited or full) for video data.

Declaration
public ColorRange ColorRange { get; set; }
Property Value
Type Description
ColorRange
View Source

ColorSpace

Gets or sets the color space for video data.

Declaration
public ColorSpace ColorSpace { get; set; }
Property Value
Type Description
ColorSpace
View Source

ColorTransferCharacteristic

Gets or sets the color transfer characteristic for video data.

Declaration
public ColorTransferCharacteristic ColorTransferCharacteristic { get; set; }
Property Value
Type Description
ColorTransferCharacteristic
View Source

ExtraData

Gets the extra binary data needed for initializing the decoder.

Declaration
public Span<byte> ExtraData { get; }
Property Value
Type Description
Span<byte>
View Source

FieldOrder

Gets or sets the field order for interlaced video (e.g., top field first).

Declaration
public FieldOrder FieldOrder { get; set; }
Property Value
Type Description
FieldOrder
View Source

FrameRate

Gets or sets the frame rate for video streams.

Declaration
public Rational FrameRate { get; set; }
Property Value
Type Description
Rational
View Source

FrameSize

Gets or sets the frame size, such as the number of audio samples per frame.

Declaration
public int FrameSize { get; set; }
Property Value
Type Description
int
View Source

Height

Gets or sets the height of the video frame in pixels.

Declaration
public int Height { get; set; }
Property Value
Type Description
int
View Source

InitialPadding

Gets or sets the initial padding for audio data, in samples.

Declaration
public int InitialPadding { get; set; }
Property Value
Type Description
int
View Source

Level

Gets or sets the codec level, which may indicate the complexity or feature set.

Declaration
public int Level { get; set; }
Property Value
Type Description
int
View Source

MediaType

Gets or sets the general type of the encoded data (e.g., video, audio).

Declaration
public MediaType MediaType { get; set; }
Property Value
Type Description
MediaType
View Source

PixelFormat

Gets or sets the pixel format, which specifies how video frames are stored and processed.

Declaration
public PixelFormat PixelFormat { get; set; }
Property Value
Type Description
PixelFormat
Remarks

Ensure the assigned value is compatible with the codec and video stream.

View Source

Profile

Gets or sets the codec profile, which defines the feature set and restrictions for the codec.

Declaration
public Profile Profile { get; set; }
Property Value
Type Description
Profile
View Source

SampleAspectRatio

Gets or sets the sample aspect ratio for video frames.

Declaration
public Rational SampleAspectRatio { get; set; }
Property Value
Type Description
Rational
View Source

SampleFormat

Gets or sets the sample format, which specifies how audio samples are stored and processed.

Declaration
public SampleFormat SampleFormat { get; set; }
Property Value
Type Description
SampleFormat
Remarks

Ensure the assigned value is compatible with the codec and audio stream.

View Source

SampleRate

Gets or sets the audio sample rate in Hz.

Declaration
public int SampleRate { get; set; }
Property Value
Type Description
int
View Source

SeekPreroll

Gets or sets the seek preroll, which is the number of samples to discard before playback starts.

Declaration
public int SeekPreroll { get; set; }
Property Value
Type Description
int
View Source

TrailingPadding

Gets or sets the trailing padding for audio data, in samples.

Declaration
public int TrailingPadding { get; set; }
Property Value
Type Description
int
View Source

VideoDelay

Gets or sets the video delay, which is the number of frames of delay for video decoding.

Declaration
public int VideoDelay { get; set; }
Property Value
Type Description
int
View Source

Width

Gets or sets the width of the video frame in pixels.

Declaration
public int Width { get; set; }
Property Value
Type Description
int

Methods

View Source

CopyFrom(CodecContext)

Copies the contents of a CodecContext instance to this instance.

Declaration
public readonly void CopyFrom(CodecContext other)
Parameters
Type Name Description
CodecContext other

The CodecContext instance to copy from.

Exceptions
Type Condition
ArgumentNullException

Thrown if other is null.

ApplicationException

Thrown if copying fails.

View Source

CopyFrom(ICodecParameters)

Copies the contents of another CodecParameters instance to this instance.

Declaration
public readonly void CopyFrom(ICodecParameters other)
Parameters
Type Name Description
ICodecParameters other

The other CodecParameters instance to copy from.

Exceptions
Type Condition
ArgumentNullException

Thrown if other is null.

ApplicationException

Thrown if copying fails.

View Source

CopyTo(CodecContext)

Copies the contents of this instance to a specified CodecContext instance.

Declaration
public readonly void CopyTo(CodecContext other)
Parameters
Type Name Description
CodecContext other

The CodecContext instance to copy to.

Exceptions
Type Condition
ArgumentNullException

Thrown if other is null.

ApplicationException

Thrown if copying fails.

View Source

GetAudioFrameDuration(int)

Calculates the duration of an audio frame based on the number of bytes in the frame.

Declaration
public readonly int GetAudioFrameDuration(int frameBytes)
Parameters
Type Name Description
int frameBytes

The number of bytes in the audio frame.

Returns
Type Description
int

The duration of the frame in samples.

View Source

SetExtraData(ReadOnlySpan<byte>)

Sets the extra binary data needed for initializing the decoder.

Declaration
public void SetExtraData(ReadOnlySpan<byte> data)
Parameters
Type Name Description
ReadOnlySpan<byte> data

The extra binary data to set.

Exceptions
Type Condition
OutOfMemoryException

Thrown if memory allocation fails.

Implements

ICodecParameters
  • View Source
In this article
Back to top Generated by DocFX