Class VideoBufferSink
Represents a video buffer sink filter that receives video frames from a filter graph.
Inherited Members
Namespace: FFmpeg.Filters.VideoFilters
Assembly: FFmpeg.dll
Syntax
public class VideoBufferSink : FilterContext, IOptionQueryable, ILoggingContext, IAVPointer<_AVFilterContext>, IBufferSource, IBufferSink
Remarks
A VideoBufferSink is the exit point for video frames from a filter graph. Frames can be retrieved using ReceiveFrame(AVFrame) after the filter graph has been configured and initialized.
Properties
View SourceAlphaMode
Gets the alpha mode of frames produced by the buffer sink filter.
Declaration
public AlphaMode AlphaMode { get; }
Property Value
| Type | Description |
|---|---|
| AlphaMode | The alpha mode of the frames received from the sink. |
ColorRange
Gets the color range of frames produced by the buffer sink filter.
Declaration
public ColorRange ColorRange { get; }
Property Value
| Type | Description |
|---|---|
| ColorRange | The color range of the frames received from the sink. |
ColorSpace
Gets the color space of frames produced by the buffer sink filter.
Declaration
public ColorSpace ColorSpace { get; }
Property Value
| Type | Description |
|---|---|
| ColorSpace | The color space of the frames received from the sink. |
FrameRate
Gets the frame rate of frames produced by the buffer sink filter.
Declaration
public Rational FrameRate { get; }
Property Value
| Type | Description |
|---|---|
| Rational | The frame rate of the frames received from the sink. |
Height
Gets the height of frames produced by the buffer sink filter.
Declaration
public int Height { get; }
Property Value
| Type | Description |
|---|---|
| int | The frame height in pixels. |
PixelAspectRatio
Gets the sample aspect ratio of frames produced by the buffer sink filter.
Declaration
public Rational PixelAspectRatio { get; }
Property Value
| Type | Description |
|---|---|
| Rational | The sample aspect ratio of the frames received from the sink. |
PixelFormat
Gets the pixel format of frames produced by the buffer sink filter.
Declaration
public PixelFormat PixelFormat { get; }
Property Value
| Type | Description |
|---|---|
| PixelFormat | The pixel format of the frames received from the sink. |
TimeBase
Gets the time base of frames produced by the buffer sink filter.
Declaration
public Rational TimeBase { get; }
Property Value
| Type | Description |
|---|---|
| Rational | The time base used for timestamps of frames received from the sink. |
Width
Gets the width of frames produced by the buffer sink filter.
Declaration
public int Width { get; }
Property Value
| Type | Description |
|---|---|
| int | The frame width in pixels. |
Methods
View SourceAllocate(string, FilterGraph)
Allocates an uninitialized video buffer sink filter.
Declaration
public static VideoBufferSink 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 |
|---|---|
| VideoBufferSink | The allocated, uninitialized video buffer sink filter. |
Exceptions
| Type | Condition |
|---|---|
| FFmpegException | The filter could not be allocated. |
Create(string, FilterGraph)
Creates and initializes a video buffer sink filter.
Declaration
public static VideoBufferSink Create(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 |
|---|---|
| VideoBufferSink | The initialized video buffer sink filter. |
Exceptions
| Type | Condition |
|---|---|
| FFmpegException | The filter could not be allocated or initialized. |
ReceiveFrame(AVFrame)
Receives the next available video frame from the buffer sink filter.
Declaration
public AVResult32 ReceiveFrame(AVFrame frame)
Parameters
| Type | Name | Description |
|---|---|---|
| AVFrame | frame | The destination frame that receives the filtered video data. |
Returns
| Type | Description |
|---|---|
| AVResult32 | The result returned by FFmpeg. |
Remarks
The supplied frame is unreferenced before receiving the new frame. The frame's TimeBase is updated to the sink's time base and its BestEffortTimestamp is set to its presentation timestamp.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|