Show / Hide Table of Contents

Class VideoFilters

Provides factory methods for creating commonly used video filters.

Inheritance
object
VideoFilters
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
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 Source

CreateFPS(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.

View Source

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 formats is empty.

View Source

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.

View Source

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.

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