Struct Filter
Represents a filter used in FFmpeg's filter graph. Provides information about filters, including their names, descriptions, inputs, outputs, and flags.
Inherited Members
Namespace: FFmpeg.Filters
Assembly: FFmpeg.dll
Syntax
public readonly struct Filter : IEquatable<Filter>, IAVPointer<_AVFilter>
Properties
View SourceAllFilters
Gets a read-only collection of all available filters in FFmpeg. The filters are initialized lazily and cached for future access.
Declaration
public static ReadOnlyCollection<Filter> AllFilters { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyCollection<Filter> |
AudioBufferSink
Gets the audio buffer sink filter, used to receive audio frames in filter graphs.
Declaration
public static Filter AudioBufferSink { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
AudioBufferSource
Gets the audio buffer source filter, used to create audio frames in filter graphs.
Declaration
public static Filter AudioBufferSource { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
AudioFormat
Gets the audio format filter, which converts audio frames to one or more specified sample formats, sample rates, channel layouts, or channel counts.
Declaration
public static Filter AudioFormat { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
AudioNullSink
Gets the built-in audio null sink filter.
Declaration
public static Filter AudioNullSink { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
Remarks
The null sink filter consumes audio frames without producing any output. It is useful when the output of a filter graph does not need to be retrieved.
AudioNullSource
Gets the built-in audio null source filter.
Declaration
public static Filter AudioNullSource { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
Remarks
The null source filter generates synthetic audio samples and is commonly used as the starting point of a filter graph when no external audio input is available.
Description
Gets a human-readable description of the filter.
Declaration
public string? Description { get; }
Property Value
| Type | Description |
|---|---|
| string | A description of the filter, or null if the filter does not provide one. |
FPS
Gets the FPS filter, used to change the frame rate of video streams.
Declaration
public static Filter FPS { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
Flags
Gets the filter's flags, indicating its properties and behavior.
Declaration
public FilterFlags Flags { get; }
Property Value
| Type | Description |
|---|---|
| FilterFlags |
FramePack
Packs two video streams into a stereoscopic video using one of the supported frame packing layouts.
Declaration
public static Filter FramePack { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
Remarks
The filter combines two input video streams into a single stereoscopic output stream and sets the appropriate stereo metadata when supported by the output codec.
Both input streams must have the same frame size and frame rate. Processing stops when the shorter input stream reaches the end.
Common packing formats include side-by-side, top-and-bottom, line-interleaved, column-interleaved, and frame-sequential.
HWDownload
Gets the filter that downloads hardware-accelerated frames to system memory.
Declaration
public static Filter HWDownload { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
HWUpload
Gets the filter that uploads frames from system memory to hardware-accelerated memory.
Declaration
public static Filter HWUpload { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
HWUploadCuda
Gets the filter that uploads frames from system memory to cuda device.
Declaration
public static Filter HWUploadCuda { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
Inputs
Gets the input pads supported by the filter.
Declaration
public FilterPadList Inputs { get; }
Property Value
| Type | Description |
|---|---|
| FilterPadList |
IsSinkFilter
Gets a value indicating whether the filter acts as a sink filter.
Declaration
public bool IsSinkFilter { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Sink filters have no output pads and consume media from a filter graph.
IsSourceFilter
Gets a value indicating whether the filter acts as a source filter.
Declaration
public bool IsSourceFilter { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Source filters have no input pads and generate media for a filter graph.
Name
Gets the name of the filter.
Declaration
public string? Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Outputs
Gets the output pads supported by the filter.
Declaration
public FilterPadList Outputs { get; }
Property Value
| Type | Description |
|---|---|
| FilterPadList |
Scale
Gets the scale filter, used to resize video frames.
Declaration
public static Filter Scale { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
VideoBufferSink
Gets the video buffer sink filter, used to receive frames in filter graphs.
Declaration
public static Filter VideoBufferSink { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
VideoBufferSource
Gets the video buffer source filter, used to create frames in filter graphs.
Declaration
public static Filter VideoBufferSource { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
VideoFormat
Gets the video format filter, which converts video frames to one or more specified pixel formats.
Declaration
public static Filter VideoFormat { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
VideoNullSink
Gets the built-in video null sink filter.
Declaration
public static Filter VideoNullSink { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
Remarks
The null sink filter consumes video frames without producing any output. It is useful when the output of a filter graph does not need to be retrieved.
VideoNullSource
Gets the built-in video null source filter.
Declaration
public static Filter VideoNullSource { get; }
Property Value
| Type | Description |
|---|---|
| Filter |
Remarks
The null source filter generates synthetic video frames and is commonly used as the starting point of a filter graph when no external video input is available.
Methods
View SourceEquals(Filter)
Declaration
public bool Equals(Filter other)
Parameters
| Type | Name | Description |
|---|---|---|
| Filter | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object?)
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
View SourceGetFilterByName(string)
Retrieves a filter by its name.
Declaration
public static Filter GetFilterByName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the filter to retrieve. |
Returns
| Type | Description |
|---|---|
| Filter | The filter associated with the specified name. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown if the filter with the specified name is not found. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
View SourceToString()
Returns the name of the filter as a string.
Declaration
public override string? ToString()
Returns
| Type | Description |
|---|---|
| string | The name of the filter. |
Overrides
View SourceTryGetFilterByName(string, out Filter)
Attempts to retrieve a filter by its name.
Declaration
public static bool TryGetFilterByName(string name, out Filter filter)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the filter to retrieve. |
| Filter | filter | When this method returns, contains the filter if found; otherwise, contains the default value. |
Returns
| Type | Description |
|---|---|
| bool |
|
Operators
View Sourceoperator ==(Filter, Filter)
Declaration
public static bool operator ==(Filter left, Filter right)
Parameters
| Type | Name | Description |
|---|---|---|
| Filter | left | |
| Filter | right |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(Filter, Filter)
Declaration
public static bool operator !=(Filter left, Filter right)
Parameters
| Type | Name | Description |
|---|---|---|
| Filter | left | |
| Filter | right |
Returns
| Type | Description |
|---|---|
| bool |