AVBlocks for .NET  1.20
Audio and Video Software Development Kit
MediaInfo Class Reference

Analyzes a file or a stream and provides information about its type and properties. More...

Inheritance diagram for MediaInfo:

Public Member Functions

 MediaInfo ()
 Creates a MediaInfo object in its default state. More...
 
void Dispose ()
 Disposes the MediaInfo and reclaims the resources used by the object. More...
 
bool Load ()
 Analyzes the input specified by the InputFile or InputStream properties. More...
 
bool Push (MediaBuffer inputBuffer)
 Pushes input data to the MediaInfo. More...
 

Properties

ErrorInfo Error [get]
 Error information for the last load operation. More...
 
String InputFile [get, set]
 The input file that should be analyzed. More...
 
System.IO.Stream InputStream [get, set]
 The input stream that should be analyzed. More...
 
StreamType InputType [get, set]
 Deprecated. More...
 
bool IsReady [get]
 Specifies if stream info and metadata has been loaded / parsed. More...
 
Metadata Metadata [get]
 Contains the metadata of the analyzed file/stream. More...
 
IList< StreamInfoStreams [get]
 A collection of StreamInfo objects describing the audio and video streams found in the input. More...
 
StreamSubType StreamSubType [get]
 Returns the stream subtype detected by MediaInfo. More...
 
StreamType StreamType [get, set]
 Forces a specific stream type on the input stream or file. More...
 

Detailed Description

Analyzes a file or a stream and provides information about its type and properties.

Constructor & Destructor Documentation

MediaInfo ( )

Creates a MediaInfo object in its default state.

When the MediaInfo object is not needed anymore it should be disposed in order to deterministically reclaim the allocated resources.

Member Function Documentation

void Dispose ( )

Disposes the MediaInfo and reclaims the resources used by the object.

bool Load ( )

Analyzes the input specified by the InputFile or InputStream properties.

Returns
true if the input has been successfully analyzed, otherwise false.

If this method is successful the information about the detected media streams (tracks) can be obtained from the Streams collection.

Referenced by MediaSocket.FromMediaInfo().

bool Push ( MediaBuffer  inputBuffer)

Pushes input data to the MediaInfo.

Parameters
inputBufferA MediaBuffer object that contains the input data.
Returns
true when the MediaInfo has successfully processed the input data, otherwise false.

In order to use this method the StreamType must be set.

See Also
MediaInfo.IsReady
Supported stream types: StreamType.Mpeg1Video
StreamType.Mpeg2Video
StreamType.H264
StreamType.MpegTS

References MediaInfo.IsReady.

Property Documentation

ErrorInfo Error
get

Error information for the last load operation.

String InputFile
getset

The input file that should be analyzed.

The default value is null.

System.IO.Stream InputStream
getset

The input stream that should be analyzed.

The default value is null. This is an alternative to InputFile.

MediaInfo will use InputFile when both InputStream and InputFile are set.

StreamType InputType
getset

Deprecated.

Please use MediaInfo.StreamType instead.

bool IsReady
get

Specifies if stream info and metadata has been loaded / parsed.

See Also
MediaInfo.Push

Referenced by MediaSocket.FromMediaInfo(), and MediaInfo.Push().

Contains the metadata of the analyzed file/stream.

The default value is null. When there's no metadata for the analyzed file/stream, null is returned.

IList<StreamInfo> Streams
get

A collection of StreamInfo objects describing the audio and video streams found in the input.

This collection is read-only. Each StreamInfo object in the collection represents a stream (track) in the analyzed input.

Returns the stream subtype detected by MediaInfo.

The default value is StreamSubType.Unknown.

Forces a specific stream type on the input stream or file.

The default value is StreamType.Unknown.

If the input is a file and StreamType is not set, the stream type is deduced from the filename extension. If the input is a stream, MediaInfo requires StreamType to be specified. If StreamType is set to something other than StreamType.Unknown, it takes precedence and is used by MediaInfo regardless of the detected stream type.