NatCorder
NatCorder is a high performance, cross-platform video recording API for Unity Engine. First, create a recorder:
var recorder = new GIFRecorder(
640,
480,
0.1
);
Next, commit a bunch of video and/or audio frames to the recorder:
Texture2D[] frames = ...;
foreach (var frame in frames)
recorder.CommitFrame(frame.GetPixels32());
And when you're all done, finish writing and use the video as you desire:
string videoPath = await recorder.FinishWriting();
NatCorder comes with a rich featureset including:
- Record any texture, anything that can be rendered into a texture, or any pixel data.
- Record to MP4 videos and animated GIF images.
- Control recording quality and file size with bitrate and keyframe interval.
- Record at any resolution. You can specify what resolution recording you want.
- Get the path to recorded video in device storage.
- Record game audio with video.
- Support for recording HEVC videos.
- Support for Android, iOS, macOS, WebGL, and Windows.
See the online docs to learn more about NatCorder.
Installing NatCorder
First, add the following items to your Unity project's Packages/manifest.json
:
{
"scopedRegistries": [
{
"name": "NatML",
"url": "https://registry.npmjs.com",
"scopes": ["ai.natml"]
}
],
"dependencies": {
"ai.natml.natcorder": "1.9.4"
}
}
Then retrieve your access key from NatML Hub and add it to your Project Settings:
Using NatCorder requires an active NatML VideoKit subscription. You can try it out for free, but functionality is limited. See the docs for more info.
Requirements
Supported Platforms
- Android API Level 24+
- iOS 14+
- macOS 10.15+ (Apple Silicon and Intel)
- Windows 10+ (64-bit only)
- WebGL:
Resources