Show / Hide Table of Contents

Class VideoBufferSource

Represents a video buffer source filter that supplies video frames to a filter graph.

Inheritance
object
OptionQueryableBase
FilterContext
VideoBufferSource
Implements
IOptionQueryable
ILoggingContext
IAVPointer<_AVFilterContext>
IBufferSink
IBufferSource
Inherited Members
FilterContext.Allocate(string, Filter, FilterGraph)
FilterContext.Create(string, Filter, FilterGraph)
FilterContext.Create(string, Filter, string, FilterGraph)
FilterContext.Create(string, Filter, AVDictionary, FilterGraph)
FilterContext.Create(string, Filter, IDictionary<string, string>, FilterGraph)
FilterContext.Create(string, Filter, AVMultiDictionary, FilterGraph)
FilterContext.As<T>()
FilterContext.Init(string)
FilterContext.Init()
FilterContext.Init(AVDictionary)
FilterContext.Init(AVMultiDictionary)
FilterContext.Init(IDictionary<string, string>)
FilterContext.GetInputFilterPad(int)
FilterContext.GetOutputFilterPad(int)
FilterContext.GetInputFilterLink(int)
FilterContext.GetOutputFilterLink(int)
FilterContext.Delete()
FilterContext.Pointer
FilterContext.Filter
FilterContext.Name
FilterContext.Threads
FilterContext.HwDeviceContext
FilterContext.ExtraHWFrames
FilterContext.InputCount
FilterContext.OutputCount
FilterContext.InputFilterPads
FilterContext.OutputFilterPads
FilterContext.InputFilterLinks
FilterContext.OutputFilterLinks
OptionQueryableBase.ResetOptions()
OptionQueryableBase.GetOptions(bool)
OptionQueryableBase.FindOption(string, bool)
OptionQueryableBase.SetOption(string, string, bool)
OptionQueryableBase.SetOption(string, long, bool)
OptionQueryableBase.SetOption(string, bool, bool)
OptionQueryableBase.SetOption(string, double, bool)
OptionQueryableBase.SetOption(string, Rational, bool)
OptionQueryableBase.SetOption(string, ReadOnlySpan<byte>, bool)
OptionQueryableBase.SetOption(string, ReadOnlyMemory<byte>, bool)
OptionQueryableBase.SetOption(string, int, int, bool)
OptionQueryableBase.SetOption(string, (int Width, int Height), bool)
OptionQueryableBase.SetOption(string, PixelFormat, bool)
OptionQueryableBase.SetOption(string, SampleFormat, bool)
OptionQueryableBase.SetOption(string, IDictionary<string, string>, bool)
OptionQueryableBase.SetOption(string, ILookup<string, string>, bool)
OptionQueryableBase.SetOption(IDictionary<string, string>, bool)
OptionQueryableBase.SetOption(string, ref ILookup<string, string>, bool)
OptionQueryableBase.SetOption<T>(string, T, bool)
OptionQueryableBase.SetOption(string, object, bool)
OptionQueryableBase.SetOption(Option, string, bool)
OptionQueryableBase.SetOption(Option, bool, bool)
OptionQueryableBase.SetOption(Option, long, bool)
OptionQueryableBase.SetOption(Option, double, bool)
OptionQueryableBase.SetOption(Option, Rational, bool)
OptionQueryableBase.SetOption(Option, ReadOnlySpan<byte>, bool)
OptionQueryableBase.SetOption(Option, ReadOnlyMemory<byte>, bool)
OptionQueryableBase.SetOption(Option, int, int, bool)
OptionQueryableBase.SetOption(Option, (int Width, int Height), bool)
OptionQueryableBase.SetOption(Option, PixelFormat, bool)
OptionQueryableBase.SetOption(Option, SampleFormat, bool)
OptionQueryableBase.SetOption(Option, IDictionary<string, string>, bool)
OptionQueryableBase.SetOption(Option, ILookup<string, string>, bool)
OptionQueryableBase.SetOption<T>(Option, T, bool)
OptionQueryableBase.SetOption(Option, object, bool)
OptionQueryableBase.TryGetOption(string, out string, bool)
OptionQueryableBase.TryGetOption(string, out long, bool)
OptionQueryableBase.TryGetOption<T>(string, out T, bool)
OptionQueryableBase.TryGetOption(string, out ulong, bool)
OptionQueryableBase.TryGetOption(string, out int, bool)
OptionQueryableBase.TryGetOption(string, out bool, bool)
OptionQueryableBase.TryGetOption(string, out uint, bool)
OptionQueryableBase.TryGetOption(string, out double, bool)
OptionQueryableBase.TryGetOption(string, out Rational, bool)
OptionQueryableBase.TryGetOption(string, out PixelFormat, bool)
OptionQueryableBase.TryGetOption(string, out SampleFormat, bool)
OptionQueryableBase.TryGetOption(string, out IDictionary<string, string>, bool)
OptionQueryableBase.TryGetOption(string, out Dictionary<string, string>, bool)
OptionQueryableBase.TryGetOption(string, out AVDictionary, bool)
OptionQueryableBase.TryGetOption(string, out ILookup<string, string>, bool)
OptionQueryableBase.TryGetOption(string, out AVMultiDictionary, bool)
OptionQueryableBase.TryGetOption(string, out int, out int, bool)
OptionQueryableBase.TryGetOption(string, out (int Width, int Height), bool)
OptionQueryableBase.TryGetOption(string, Span<byte>, bool)
OptionQueryableBase.TryGetOption(string, out byte[], bool)
OptionQueryableBase.TryGetOption(string, out Memory<byte>, bool)
OptionQueryableBase.TryGetOption(string, out ReadOnlyMemory<byte>, bool)
OptionQueryableBase.TryGetOption(string, out object, bool)
OptionQueryableBase.TryGetOption(Option, out string, bool)
OptionQueryableBase.TryGetOption(Option, out long, bool)
OptionQueryableBase.TryGetOption<T>(Option, out T, bool)
OptionQueryableBase.TryGetOption(Option, out ulong, bool)
OptionQueryableBase.TryGetOption(Option, out int, bool)
OptionQueryableBase.TryGetOption(Option, out bool, bool)
OptionQueryableBase.TryGetOption(Option, out uint, bool)
OptionQueryableBase.TryGetOption(Option, out double, bool)
OptionQueryableBase.TryGetOption(Option, out Rational, bool)
OptionQueryableBase.TryGetOption(Option, out PixelFormat, bool)
OptionQueryableBase.TryGetOption(Option, out SampleFormat, bool)
OptionQueryableBase.TryGetOption(Option, out IDictionary<string, string>, bool)
OptionQueryableBase.TryGetOption(Option, out Dictionary<string, string>, bool)
OptionQueryableBase.TryGetOption(Option, out AVDictionary, bool)
OptionQueryableBase.TryGetOption(Option, out ILookup<string, string>, bool)
OptionQueryableBase.TryGetOption(Option, out AVMultiDictionary, bool)
OptionQueryableBase.TryGetOption(Option, out int, out int, bool)
OptionQueryableBase.TryGetOption(Option, out (int Width, int Height), bool)
OptionQueryableBase.TryGetOption(Option, out byte[], bool)
OptionQueryableBase.TryGetOption(Option, out Memory<byte>, bool)
OptionQueryableBase.TryGetOption(Option, out ReadOnlyMemory<byte>, bool)
OptionQueryableBase.TryGetOption(Option, Span<byte>, bool)
OptionQueryableBase.TryGetOption(Option, out object, bool)
OptionQueryableBase.SetOption(string, ChannelLayout, bool)
OptionQueryableBase.SetOption(Option, ChannelLayout, bool)
OptionQueryableBase.TryGetOption(string, out ChannelLayout, bool)
OptionQueryableBase.TryGetOption(Option, out ChannelLayout, bool)
object.GetType()
object.MemberwiseClone()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: FFmpeg.Filters.VideoFilters
Assembly: FFmpeg.dll
Syntax
public class VideoBufferSource : FilterContext, IOptionQueryable, ILoggingContext, IAVPointer<_AVFilterContext>, IBufferSink, IBufferSource
Remarks

A VideoBufferSource is the entry point for video frames into a filter graph. It can be configured using explicit video parameters, BufferSrcParameters, a CodecContext, or an AVStream.

Properties

View Source

AlphaMode

Gets or sets the alpha mode of the video frames.

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

The alpha mode, or Unspecified if the option could not be read.

View Source

ColorRange

Gets or sets the color range of the video frames.

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

The color range, or Unspecified if the option could not be read.

View Source

ColorSpace

Gets or sets the color space of the video frames.

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

The color space, or Unspecified if the option could not be read.

View Source

FrameRate

Gets or sets the frame rate of the video source.

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

The frame rate of the video source.

View Source

Height

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

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

The frame height in pixels, or 0 if the option could not be read.

View Source

PixelAspectRation

Gets or sets the sample aspect ratio of the video frames.

Declaration
public Rational PixelAspectRation { get; set; }
Property Value
Type Description
Rational

The sample aspect ratio of the video frames.

View Source

PixelFormat

Gets or sets the pixel format of the video frames accepted by the source filter.

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

The pixel format, or None if the option could not be read.

View Source

Size

Gets or sets the dimensions of the video frames.

Declaration
public (int Width, int Height) Size { get; set; }
Property Value
Type Description
(int Width, int Height)

A tuple containing the width and height of the video frames.

View Source

TimeBase

Gets or sets the time base of the video frames.

Declaration
public Rational TimeBase { get; set; }
Property Value
Type Description
Rational

The time base used for timestamps of frames submitted to the source.

View Source

Width

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

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

The frame width in pixels, or 0 if the option could not be read.

Methods

View Source

Allocate(string, FilterGraph)

Allocates an uninitialized video buffer source filter.

Declaration
public static VideoBufferSource Allocate(string name, FilterGraph graph)
Parameters
Type Name Description
string name

The name of the filter instance.

FilterGraph graph

The filter graph that will own the filter.

Returns
Type Description
VideoBufferSource

The allocated, uninitialized video buffer source filter.

Remarks

The returned filter has not been initialized. Configure its options or properties as required and call Init() before using it in the filter graph.

Exceptions
Type Condition
FFmpegException

The filter could not be allocated.

View Source

Create(string, CodecContext, FilterGraph)

Creates and initializes a video buffer source filter from a codec context.

Declaration
public static VideoBufferSource Create(string name, CodecContext ctx, FilterGraph graph)
Parameters
Type Name Description
string name

The name of the filter instance.

CodecContext ctx

The codec context containing the video format parameters.

FilterGraph graph

The filter graph that will own the filter.

Returns
Type Description
VideoBufferSource

The initialized video buffer source filter.

Remarks

The source is configured from the codec context's video properties, including its dimensions, pixel format, time base, frame rate, color information, alpha mode, and pixel aspect ratio.

Exceptions
Type Condition
ArgumentException

ctx does not represent a video codec.

FFmpegException

The filter could not be allocated, configured, or initialized.

View Source

Create(string, BufferSrcParameters, FilterGraph)

Creates and initializes a video buffer source filter from the specified buffer source parameters.

Declaration
public static VideoBufferSource Create(string name, BufferSrcParameters parameters, FilterGraph graph)
Parameters
Type Name Description
string name

The name of the filter instance.

BufferSrcParameters parameters

The parameters describing the video source.

FilterGraph graph

The filter graph that will own the filter.

Returns
Type Description
VideoBufferSource

The initialized video buffer source filter.

Remarks

The supplied parameters must describe a video source. Audio parameters are rejected because this class represents a video buffer source.

Exceptions
Type Condition
ArgumentException

parameters does not describe a video source.

FFmpegException

The filter could not be configured or initialized.

View Source

Create(string, AVStream, FilterGraph)

Creates and initializes a video buffer source filter from an input stream.

Declaration
public static VideoBufferSource Create(string name, AVStream stream, FilterGraph graph)
Parameters
Type Name Description
string name

The name of the filter instance.

AVStream stream

The input stream containing the video format parameters.

FilterGraph graph

The filter graph that will own the filter.

Returns
Type Description
VideoBufferSource

The initialized video buffer source filter.

Remarks

The source is configured from the stream's codec parameters and timing information.

Exceptions
Type Condition
ArgumentException

stream does not represent a video stream.

FFmpegException

The filter could not be allocated, configured, or initialized.

View Source

Create(string, int, int, PixelFormat, Rational, FilterGraph)

Creates and initializes a video buffer source filter using the specified video format.

Declaration
public static VideoBufferSource Create(string name, int width, int height, PixelFormat format, Rational timeBase, FilterGraph graph)
Parameters
Type Name Description
string name

The name of the filter instance.

int width

The width of the video frames, in pixels.

int height

The height of the video frames, in pixels.

PixelFormat format

The pixel format of the video frames.

Rational timeBase

The time base of the input video stream.

FilterGraph graph

The filter graph that will own the filter.

Returns
Type Description
VideoBufferSource

The initialized video buffer source filter.

Remarks

Unlike Allocate(string, FilterGraph), this method initializes the filter before returning it, leaving it ready to receive frames.

Exceptions
Type Condition
FFmpegException

The filter could not be configured or initialized.

View Source

Drain()

Signals end-of-stream to the video buffer source filter.

Declaration
public AVResult32 Drain()
Returns
Type Description
AVResult32

The result returned by FFmpeg.

Remarks

After end-of-stream has been signaled, no further frames can be submitted to the source filter.

View Source

SendFrame(AVFrame?, bool)

Sends a frame to the video buffer source filter.

Declaration
public AVResult32 SendFrame(AVFrame? frame, bool keepRef = false)
Parameters
Type Name Description
AVFrame frame

The frame to send, or null to signal end-of-stream.

bool keepRef

true to retain a reference to the supplied frame; false to allow FFmpeg to take ownership of the frame when possible.

Returns
Type Description
AVResult32

The result returned by FFmpeg.

Remarks

When keepRef is true, FFmpeg creates a new reference to the supplied frame. When it is false, ownership of the frame may be transferred to the filter.

View Source

SetBufferSourceParameters(BufferSrcParameters)

Sets the parameters of a buffer source filter.

Declaration
public AVResult32 SetBufferSourceParameters(BufferSrcParameters parameters)
Parameters
Type Name Description
BufferSrcParameters parameters

The buffer source parameters to apply.

Returns
Type Description
AVResult32

The result of the operation.

View Source

ToString()

Returns a string representation of the video format.

Declaration
public override string ToString()
Returns
Type Description
string

A string containing the video dimensions and pixel format.

Overrides
FilterContext.ToString()

Implements

IOptionQueryable
ILoggingContext
IAVPointer<T>
IBufferSink
IBufferSource

Extension Methods

LoggingContextExtensions.Debug(ILoggingContext, string)
LoggingContextExtensions.Error(ILoggingContext, string)
LoggingContextExtensions.Fatal(ILoggingContext, string)
LoggingContextExtensions.Info(ILoggingContext, string)
LoggingContextExtensions.Log(ILoggingContext, LogLevel, string)
LoggingContextExtensions.Panic(ILoggingContext, string)
LoggingContextExtensions.Trace(ILoggingContext, string)
LoggingContextExtensions.Verbose(ILoggingContext, string)
LoggingContextExtensions.Warning(ILoggingContext, string)
  • View Source
In this article
Back to top Generated by DocFX