Aurigma Graphics Mill 5.5 for .NET
WMReader Class
This class is used to read frames from video files using Windows Media framework.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill.Codecs.MediaProcessor (in Aurigma.GraphicsMill.Codecs.MediaProcessor.dll)
Syntax
Visual Basic
Public NotInheritable Class WMReader _ Inherits FormatReader _ Implements IFrameEnumerator, IMediaProcessorMetadataReadSupport, ITimeReader
C#
public sealed class WMReader : FormatReader, IFrameEnumerator, IMediaProcessorMetadataReadSupport, ITimeReader
Remarks
Windows Media is intended to work with the ASF, WMV, WMA and MP3 formats. Therefore, this framework is recommended to use when reading files of these types. Compared to other frameworks, Windows Media provides a better support of ID3 metadata. For the list of supported file formats, see the System Requirements section of the manual.
Video files are represented as a sequence of images which are called frames. The WMReader class allows extracting frames using the LoadFrame(Int32) method. Also, the reader object can be interpreted as a collection of frames, and therefore the frames can be enumerated using the foreach statement.
A WMReader object can be used not only to read video data, but also to extract some information about the opened file. For example, you can get:
- Duration (the Duration property).
- Number of frames per second (the FramesPerSecond property).
- Collection of metadata (the Metadata property).
In general the reader usage workflow should be as follows:
- Create a WMReader instance.
- Open the reader using the Open(String) method.
- If necessary, read the Duration, Metadata and FramesPerSecond properties.
-
Iterate through each frame in the reader using the LoadFrame(Int32) method. It will return a WMFrame class instance. To extract the image from the frame, use the GetBitmap(Bitmap) method.
To get the total number of the frames in the reader, read the FrameCount property.
Examples
Visual Basic
Private Sub WMReaderUsage(ByVal aPath As String)
Dim aReader As WMReader = New WMReader(aPath)
'Work with the reader
aReader.Dispose()
End Sub
C#
private void WMReaderUsage(String aPath)
{
WMReader aReader = new WMReader(aPath);
//Work with the reader
aReader.Dispose();
}






