Class VideoFilters
Provides factory methods for creating commonly used video filters.
Inherited Members
Namespace: FFmpeg.Filters.VideoFilters
Assembly: FFmpeg.dll
Syntax
public static class VideoFilters
Remarks
This class contains convenience methods for creating and initializing video filter contexts. All methods automatically allocate and initialize the created filter.
Methods
View SourceCreateFPS(string, Rational, FilterGraph)
Creates a video frame rate filter.
Declaration
public static FilterContext CreateFPS(string name, Rational fps, FilterGraph graph)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the filter instance. |
| Rational | fps | The desired output frame rate. |
| FilterGraph | graph | The filter graph that will own the filter. |
Returns
| Type | Description |
|---|---|
| FilterContext | The initialized frame rate filter. |
Remarks
The FPS filter converts the input stream to the specified output frame rate by dropping or duplicating frames as needed.
CreateFormat(string, FilterGraph, params ReadOnlySpan<PixelFormat>)
Creates a video format filter context that converts input video frames to one of the specified pixel formats. When multiple formats are specified, libavfilter selects a format suitable for the next filter in the filter graph.
Declaration
public static FilterContext CreateFormat(string name, FilterGraph graph, params ReadOnlySpan<PixelFormat> formats)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name to assign to the filter context. |
| FilterGraph | graph | The FilterGraph to which the filter context belongs. |
| ReadOnlySpan<PixelFormat> | formats | The pixel formats to which the input video may be converted. |
Returns
| Type | Description |
|---|---|
| FilterContext | A new FilterContext configured with the specified pixel formats. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when |
CreateFormat(string, PixelFormat, FilterGraph)
Creates a video format filter context that converts input video frames to the specified pixel format.
Declaration
public static FilterContext CreateFormat(string name, PixelFormat format, FilterGraph graph)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name to assign to the filter context. |
| PixelFormat | format | The pixel format to convert the input video to. |
| FilterGraph | graph | The FilterGraph to which the filter context belongs. |
Returns
| Type | Description |
|---|---|
| FilterContext | A new FilterContext configured to convert video frames to the specified pixel format. |
CreateScale(string, int, int, FilterGraph)
Creates a video scale filter.
Declaration
public static FilterContext CreateScale(string name, int width, int height, FilterGraph graph)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the filter instance. |
| int | width | The output width, in pixels. |
| int | height | The output height, in pixels. |
| FilterGraph | graph | The filter graph that will own the filter. |
Returns
| Type | Description |
|---|---|
| FilterContext | The initialized scale filter. |
Remarks
The scale filter resizes video frames to the specified dimensions.