> ## Documentation Index
> Fetch the complete documentation index at: https://dacruzdev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Sequence Recording with SequenceRecorder in ScreenshotKit

> Record image sequences frame by frame to disk using the SequenceRecorder singleton, with PNG, JPEG, TGA, EXR, and optional matte passes.

## Usage

```csharp theme={null}
using DaCruz.ScreenshotKit;
using UnityEngine;

public class SequenceController : MonoBehaviour
{
    public Camera cam;

    void StartCapture()
    {
        var seq = new SequenceRecorder.RecordingSettings
        {
            SourceCamera          = cam,
            OutputFolder          = Application.dataPath + "/../Captures/MyShot",
            FilePrefix            = "shot",
            FrameRate             = 30,
            Resolution            = SequenceRecorder.Resolution.Full,
            MaxDuration           = 5f,
            Format                = SequenceRecorder.ImageFormat.PNG,
            TransparentBackground = false,
            RenderMattes          = false,
        };

        SequenceRecorder.Instance.StartRecording(seq);
    }

    void StopCapture()
    {
        SequenceRecorder.Instance.StopRecording();   // finishes pending writes
        // or: SequenceRecorder.Instance.CancelRecording();
    }
}
```

The output is a folder of `shot_000000.png`, `shot_000001.png`, and so on. With `RenderMattes = true`, each enabled matte pass writes into its own subfolder per frame.

## Manual per-frame capture

To capture individual frames yourself (no automatic loop), call `ScreenshotCapture.CaptureSequenceFrame` per frame. It returns a `Texture2D` you encode and save however you like. `CaptureSequenceFrameWithMattes` adds matte passes per frame into subfolders.

<Warning>
  `SequenceRecorder` refuses to start outside Play Mode. Per-frame matte rendering is heavy; prefer capturing without mattes when performance matters.
</Warning>

## See also

* [Image Sequence workflow](/workflows/image-sequence) for the editor-window equivalent.
* [GifRecorder](/api/gif-recorder) for an encoded looping GIF instead of stills.
