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
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.
SequenceRecorder refuses to start outside Play Mode. Per-frame matte rendering is heavy; prefer capturing without mattes when performance matters.
GifRecorder for an encoded looping GIF instead of stills.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"ScreenshotKit","colors":{"primary":"#FC9712","light":"#FFAB3D","dark":"#E08200"},"favicon":"https://media.brand.dev/3eaeb0c7-8a30-4d73-bd42-28044ced7d33.png","navbar":{"links":[{"href":"https://dacruz.dev","label":"daCruz.dev"}],"primary":{"type":"button","label":"Get it on the Asset Store","href":"https://assetstore.unity.com/preview/356348/1300078"}},"footer":{"socials":{"website":"https://dacruz.dev"}},"search":{"prompt":"Search the ScreenshotKit docs..."},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"dacruzdev","hasAudioNarration":false,"actualSubdomain":"dacruzdev","customDomains":[],"gitSource":{"type":"github","owner":"mintlify-community","repo":"docs-dacruzdev-1549b199","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae95bcf37dad6e4be6c5210:success","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"Documentation","count":20},{"language":"default","tag":"Workflows","count":8},{"language":"default","tag":"Runtime API","count":7},{"language":"default","tag":"Configuration","count":5},{"language":"default","tag":"Screenshots","count":4},{"language":"default","tag":"Reference","count":4},{"language":"default","tag":"Get Started","count":3},{"language":"default","tag":"Recording","count":2},{"language":"default","tag":"Overview","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api/sequence-recorder","slug":"/api/sequence-recorder","pageMetadata":{"title":"Image Sequence Recording with SequenceRecorder in ScreenshotKit","sidebarTitle":"SequenceRecorder","description":"Record image sequences frame by frame to disk using the SequenceRecorder singleton, with PNG, JPEG, TGA, EXR, and optional matte passes.","href":"/api/sequence-recorder"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Record image sequences frame by frame to disk using the SequenceRecorder singleton, with PNG, JPEG, TGA, EXR, and optional matte passes.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`usage`,children:`Usage`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`31`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`31`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` DaCruz`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`ScreenshotKit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` UnityEngine`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` SequenceController`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` : `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`MonoBehaviour`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Camera`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` cam`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` StartCapture`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` seq`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` SequenceRecorder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`RecordingSettings`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SourceCamera`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` cam`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OutputFolder`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Application`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`dataPath`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/../Captures/MyShot\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FilePrefix`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"shot\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FrameRate`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 30`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Resolution`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SequenceRecorder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Resolution`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Full`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` MaxDuration`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 5f`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Format`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SequenceRecorder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ImageFormat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`PNG`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` TransparentBackground`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` RenderMattes`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` };`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SequenceRecorder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`StartRecording`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`seq`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` StopCapture`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SequenceRecorder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`StopRecording`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// finishes pending writes`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // or: SequenceRecorder.Instance.CancelRecording();`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The output is a folder of `,_jsx(_components.code,{children:`shot_000000.png`}),`, `,_jsx(_components.code,{children:`shot_000001.png`}),`, and so on. With `,_jsx(_components.code,{children:`RenderMattes = true`}),`, each enabled matte pass writes into its own subfolder per frame.`]}),`\n`,_jsx(Heading,{level:`2`,id:`manual-per-frame-capture`,children:`Manual per-frame capture`}),`\n`,_jsxs(_components.p,{children:[`To capture individual frames yourself (no automatic loop), call `,_jsx(_components.code,{children:`ScreenshotCapture.CaptureSequenceFrame`}),` per frame. It returns a `,_jsx(_components.code,{children:`Texture2D`}),` you encode and save however you like. `,_jsx(_components.code,{children:`CaptureSequenceFrameWithMattes`}),` adds matte passes per frame into subfolders.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`SequenceRecorder`}),` refuses to start outside Play Mode. Per-frame matte rendering is heavy; prefer capturing without mattes when performance matters.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`see-also`,children:`See also`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/workflows/image-sequence`,children:`Image Sequence workflow`}),` for the editor-window equivalent.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/api/gif-recorder`,children:`GifRecorder`}),` for an encoded looping GIF instead of stills.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Image Sequence Recording with SequenceRecorder in ScreenshotKit","sidebarTitle":"SequenceRecorder","description":"Record image sequences frame by frame to disk using the SequenceRecorder singleton, with PNG, JPEG, TGA, EXR, and optional matte passes.","href":"/api/sequence-recorder"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Usage","slug":"usage","depth":2,"children":[]},{"title":"Manual per-frame capture","slug":"manual-per-frame-capture","depth":2,"children":[]},{"title":"See also","slug":"see-also","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"dacruzdev","siteName":"ScreenshotKit","title":"Image Sequence Recording with SequenceRecorder in ScreenshotKit - ScreenshotKit","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-23T09:13:26.120Z","originalFileLocation":"api/sequence-recorder.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Record image sequences frame by frame to disk using the SequenceRecorder singleton, with PNG, JPEG, TGA, EXR, and optional matte passes.\">\u003cmeta data-mint-head name=\"application-name\" content=\"ScreenshotKit\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://media.brand.dev/3eaeb0c7-8a30-4d73-bd42-28044ced7d33.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://media.brand.dev/3eaeb0c7-8a30-4d73-bd42-28044ced7d33.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://media.brand.dev/3eaeb0c7-8a30-4d73-bd42-28044ced7d33.png\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/png\" href=\"https://media.brand.dev/3eaeb0c7-8a30-4d73-bd42-28044ced7d33.png\">\u003cmeta data-mint-head property=\"og:title\" content=\"Image Sequence Recording with SequenceRecorder in ScreenshotKit - ScreenshotKit\">\u003cmeta data-mint-head property=\"og:description\" content=\"Record image sequences frame by frame to disk using the SequenceRecorder singleton, with PNG, JPEG, TGA, EXR, and optional matte passes.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ScreenshotKit\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://dacruzdev.mintlify.app/api/sequence-recorder\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dacruzdev.mintlify.site/_mintlify/api/og/v2?division=Recording\u0026amp;title=Image+Sequence+Recording+with+SequenceRecorder+in+ScreenshotKit\u0026amp;description=Record+image+sequences+frame+by+frame+to+disk+using+the+SequenceRecorder+singleton%2C+with+PNG%2C+JPEG%2C+TGA%2C+EXR%2C+and+optional+matte+passes.\u0026amp;theme=6d5064476cb4455435876005\u0026amp;signature=fcd287f364484001ef5080cfa53e2483356ffa5b955f972b3d96bd8a7f88084a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Image Sequence Recording with SequenceRecorder in ScreenshotKit - ScreenshotKit\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Record image sequences frame by frame to disk using the SequenceRecorder singleton, with PNG, JPEG, TGA, EXR, and optional matte passes.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dacruzdev.mintlify.site/_mintlify/api/og/v2?division=Recording\u0026amp;title=Image+Sequence+Recording+with+SequenceRecorder+in+ScreenshotKit\u0026amp;description=Record+image+sequences+frame+by+frame+to+disk+using+the+SequenceRecorder+singleton%2C+with+PNG%2C+JPEG%2C+TGA%2C+EXR%2C+and+optional+matte+passes.\u0026amp;theme=6d5064476cb4455435876005\u0026amp;signature=fcd287f364484001ef5080cfa53e2483356ffa5b955f972b3d96bd8a7f88084a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/dacruzdev/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ScreenshotKit\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FC9712\">\u003clink data-mint-head rel=\"canonical\" href=\"https://dacruzdev.mintlify.app/api/sequence-recorder\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/sequence-recorder.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://dacruzdev.mintlify.app/#organization\",\"name\":\"ScreenshotKit\",\"url\":\"https://dacruzdev.mintlify.app\"},{\"@type\":\"WebSite\",\"@id\":\"https://dacruzdev.mintlify.app#website\",\"name\":\"ScreenshotKit\",\"url\":\"https://dacruzdev.mintlify.app\",\"publisher\":{\"@id\":\"https://dacruzdev.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://dacruzdev.mintlify.app/api/sequence-recorder#webpage\",\"url\":\"https://dacruzdev.mintlify.app/api/sequence-recorder\",\"name\":\"Image Sequence Recording with SequenceRecorder in ScreenshotKit\",\"description\":\"Record image sequences frame by frame to disk using the SequenceRecorder singleton, with PNG, JPEG, TGA, EXR, and optional matte passes.\",\"dateModified\":\"2026-07-23T09:13:26.120Z\",\"isPartOf\":{\"@id\":\"https://dacruzdev.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://dacruzdev.mintlify.app/api/sequence-recorder#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://dacruzdev.mintlify.app/api/sequence-recorder#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Recording\",\"item\":\"https://dacruzdev.mintlify.app/api/gif-recorder\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Image Sequence Recording with SequenceRecorder in ScreenshotKit\",\"item\":\"https://dacruzdev.mintlify.app/api/sequence-recorder\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://dacruzdev.mintlify.app/api/sequence-recorder#article\",\"headline\":\"Image Sequence Recording with SequenceRecorder in ScreenshotKit\",\"name\":\"Image Sequence Recording with SequenceRecorder in ScreenshotKit\",\"description\":\"Record image sequences frame by frame to disk using the SequenceRecorder singleton, with PNG, JPEG, TGA, EXR, and optional matte passes.\",\"url\":\"https://dacruzdev.mintlify.app/api/sequence-recorder\",\"mainEntityOfPage\":{\"@id\":\"https://dacruzdev.mintlify.app/api/sequence-recorder#webpage\"},\"dateModified\":\"2026-07-23T09:13:26.120Z\",\"publisher\":{\"@id\":\"https://dacruzdev.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://dacruzdev.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ScreenshotKit\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"ScreenshotKit\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api/sequence-recorder.md","siteName":"ScreenshotKit","nav":{"global":null,"tabs":[{"tab":"Documentation","icon":"book-open-lines","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"Runtime API","icon":"code","groups":[{"group":"Overview","pages":[{"title":"ScreenshotKit Runtime API Overview","sidebarTitle":"Overview","href":"/api/overview"}]},{"group":"Screenshots","pages":[{"title":"Single-Frame Screenshot Capture in ScreenshotKit","sidebarTitle":"Capture","href":"/api/capture"},{"title":"Transparent Background Capture in ScreenshotKit","sidebarTitle":"Transparent Capture","href":"/api/transparent-capture"},{"title":"Cryptomatte and AOV Capture with Mattes in ScreenshotKit","sidebarTitle":"Capture with Mattes","href":"/api/capture-with-mattes"},{"title":"The ScreenshotKitCapture Runtime Component","sidebarTitle":"Runtime Component","href":"/api/runtime-component"}]},{"group":"Recording","pages":[{"title":"Animated GIF Recording with GifRecorder in ScreenshotKit","sidebarTitle":"GifRecorder","description":"Record and encode animated GIFs at runtime using the GifRecorder singleton: configure frame rate, quality, and palette, and wire up encoding events.","href":"/api/gif-recorder"},{"title":"Image Sequence Recording with SequenceRecorder in ScreenshotKit","sidebarTitle":"SequenceRecorder","href":"/api/sequence-recorder"}]}]}]},"basePath":"","title":"Image Sequence Recording with SequenceRecorder in ScreenshotKit - ScreenshotKit","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":[],"chunks":[]}