Fundamentals
What You Should Know
NatCorder provides all recording functionality with implementations of a single interface: IMediaRecorder
. At the highest level, NatCorder works by encoding video and audio frames on-demand. As a result, recording always follows three steps:
Starting a Recording Session
The first step is to start a recording session by creating a recorder.
There is no defined limit on the number of simultaneous recording sessions, but the actual limit will vary by device.
Committing Frames
Once you have created a recorder, you will commit video and/or audio frames to the recorder.
Committing Video Frames
When committing video frames, the recorder always expects a pixel buffer with an RGBA8888
layout in memory. You will use the CommitFrame
method to commit video frames.
The CommitFrame
method takes in any managed numeric array which can be interpreted as a pixel buffer.
Committing Audio Frames
When committing audio frames, the recorder always expects a single precision floating point (float
) linear PCM sample buffer, interleaved by channel. You will use the CommitSamples
method to commit audio frames.
Finishing a Recording Session
Once you are done recording, simply call the FinishWriting
method:
The recorder will finish its operations, cleanup any resources, then return a path to the recorded video.
Last updated