---
title: "QTReader Class"
canonical: https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_QTReader.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# QTReader Class
 
This class is used to read frames from video files using QuickTime framework.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill.Codecs.MediaProcessor (in Aurigma.GraphicsMill.Codecs.MediaProcessor.dll)
 
## Syntax
  
```
Public NotInheritable Class QTReader _Inherits FormatReader _Implements IMediaProcessorMetadataReadSupport, ITimeReader
```
 
```csharp
public sealed class QTReader : FormatReader, IMediaProcessorMetadataReadSupport, ITimeReader
```
 
## Remarks
  
QuickTime opens files of almost all formats, though it is a bit slow. This framework is recommended to use when reading MOV and different graphic formats. For the list of supported file formats, see the [System Requirements](https://www.graphicsmill.com/docs/gm5/MediaProcessorSystemRequirements.htm.md) section of the manual.
 
Video files are represented as a sequence of images which are called *frames*. The QTReader class allows extracting frames using the [LoadFrame(Int32)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_FormatReader_LoadFrame_1_e1836fc4.htm.md) 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 QTReader 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](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_QTReader_Duration.htm.md) property).
- Number of frames per second (the [FramesPerSecond](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_QTReader_FramesPerSecond.htm.md) property).
- Collection of metadata (the [Metadata](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_QTReader_Metadata.htm.md) property).

In general the reader usage workflow should be as follows:
 
1. Create a QTReader instance.
2. Open the reader using the [Open(String)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_FormatReader_Open_1_bb3a7a4f.htm.md) method. 
**Note**
You cannot get any data from the reader until you open it on some file.
3. If necessary, read the [Duration](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_QTReader_Duration.htm.md), [Metadata](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_QTReader_Metadata.htm.md) and [FramesPerSecond](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_QTReader_FramesPerSecond.htm.md) properties.
4. Iterate through each frame in the reader using the [LoadFrame(Int32)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_FormatReader_LoadFrame_1_e1836fc4.htm.md) method. It will return a [QTFrame](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_QTFrame.htm.md) class instance. To extract the image from the frame, use the [GetBitmap(Bitmap)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_Frame_GetBitmap_1_fd4033ef.htm.md) method.
 
    To get the total number of the frames in the reader, read the [FrameCount](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_FormatReader_FrameCount.htm.md) property.
 
## Examples
 This example shows the general pattern of working with the reader. ```
Private Sub QTReaderUsage(ByVal aPath As String)
    Dim aReader As QTReader = New QTReader(aPath)
    'Work with the reader
    aReader.Dispose()
End Sub
``````csharp
private void QTReaderUsage(String aPath)
{
    QTReader aReader = new QTReader(aPath);
    //Work with the reader
    aReader.Dispose();
}
```
 
## Inheritance Hierarchy
  
- [System.Object](http://msdn2.microsoft.com/en-us/e5kfa45b)
    - [Aurigma.GraphicsMill.SyncHandler](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_SyncHandler.htm.md)
        - [Aurigma.GraphicsMill.Codecs.FormatReader](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_FormatReader.htm.md)
            - Aurigma.GraphicsMill.Codecs.QTReader
 
## Thread Safety
 Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.
 
## Object Model

[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill.Codecs.MediaProcessor_ObjectModel_23.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_QTReader.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel2.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill.Codecs.MediaProcessor_ObjectModel_11.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_IFrame.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel1.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill.Codecs.MediaProcessor_ObjectModel_17.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_MediaProcessorMetadataDictionary.htm.md)
  
## See Also

### Reference

- [QTReader Members](https://www.graphicsmill.com/docs/gm5/AllMembers_T_Aurigma_GraphicsMill_Codecs_QTReader.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
