Table of Contents

Class FFmpegMedia

Namespace
Stride.Video.FFmpeg
Assembly
Stride.Video.dll

Represents a media, i.e. a context with a collection of streams and associated codecs from a unique source.

public sealed class FFmpegMedia : IDisposable
Inheritance
FFmpegMedia
Implements
Extension Methods

Constructors

FFmpegMedia(GraphicsDevice)

Initializes a new instance of the FFmpegMedia class.

public FFmpegMedia(GraphicsDevice graphicsDevice = null)

Parameters

graphicsDevice GraphicsDevice

Fields

Logger

public static Logger Logger

Field Value

Logger

Properties

Duration

The duration of the media.

public TimeSpan Duration { get; }

Property Value

TimeSpan

Streams

A collection of streams retrieved from this media.

public IReadOnlyList<FFmpegStream> Streams { get; }

Property Value

IReadOnlyList<FFmpegStream>

Remarks

The collection is empty until the media is open.

Url

The url to the media.

public string Url { get; }

Property Value

string

Remarks

It can include a specific protocol such as http or subfile.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

ExtractFrames(FFmpegStream, int)

public int ExtractFrames(FFmpegStream stream, int count)

Parameters

stream FFmpegStream
count int

Returns

int

GetStreamInfo(VideoStream)

public FFmpegMedia.StreamInfo GetStreamInfo(VideoStream stream)

Parameters

stream VideoStream

Returns

FFmpegMedia.StreamInfo

IsStereoscopicVideo(FFmpegStream)

Returns true if the provided stream is a stereoscopic video.

public bool IsStereoscopicVideo(FFmpegStream stream)

Parameters

stream FFmpegStream

Returns

bool

Remarks

This function may read the first frame of the video if necessary

Open(string, long, long)

Opens this media.

public void Open(string url, long startPosition = 0, long length = -1)

Parameters

url string
startPosition long
length long

Remarks

Once the media is open, the collection of Streams is populated.

SeekToTime(FFmpegStream, long)

public bool SeekToTime(FFmpegStream stream, long timestamp)

Parameters

stream FFmpegStream
timestamp long

Returns

bool