NatCorder
Search…
CameraInput
class NatML.Recorders.Inputs.CameraInput
The CameraInput simplifies the process of recording video from one or multiple game cameras.
The CameraInput does not support recording Unity UI canvases that render using the Screen Space - Overlay mode. This is a limitation of Unity Engine.

Creating the Input

The camera input can be created with either a destination IMediaRecorder or ITextureInput:

From a Recorder

/// <summary>
/// Create a video recording input from a game camera.
/// </summary>
/// <param name="recorder">Media recorder to receive committed frames.</param>
/// <param name="clock">Clock for generating timestamps.</param>
/// <param name="cameras">Game cameras to record.</param>
CameraInput (IMediaRecorder recorder, IClock clock, params Camera[] cameras);
The camera input is created with a recorder which receives video frames from the game cameras. There is a constructor which does not accept a clock, for recorders like the GIFRecorder and JPGRecorder which do not use timestamps:
/// <summary>
/// Create a video recording input from one or more game cameras.
/// </summary>
/// <param name="recorder">Media recorder to receive video frames.</param>
/// <param name="cameras">Game cameras to record.</param>
CameraInput (IMediaRecorder recorder, params Camera[] cameras);

From a Texture Input

/// <summary>
/// Create a video recording input from one or more game cameras.
/// </summary>
/// <param name="input">Texture input to receive video frames.</param>
/// <param name="cameras">Game cameras to record.</param>
CameraInput (ITextureInput input, IClock clock, params Camera[] cameras);
INCOMPLETE.
/// <summary>
/// Create a video recording input from one or more game cameras.
/// </summary>
/// <param name="input">Texture input to receive video frames.</param>
/// <param name="cameras">Game cameras to record.</param>
CameraInput (ITextureInput input, params Camera[] cameras);

Skipping Frames

/// <summary>
/// Control number of successive camera frames to skip while recording.
/// </summary>
int frameSkip { get; set; }
The CameraInput typically commits frames from the game camera(s) on every Unity update. You can reduce this frequency by increasing the frameSkip property. This is especially useful for creating animated GIF images which typically have a low frame rate look. It can also provide performance increases in GPU-bound applications.

HDR Recording

/// <summary>
/// Configure the camera input for HDR or post-processing FX rendering.
/// </summary>
bool HDR { get; set; }
INCOMPLETE.

Disposing the Input

/// <summary>
/// Stop recorder input and release resources.
/// </summary>
void Dispose ();
When you choose to stop recording, simply dispose the recorder input. You will typically do this before calling FinishWriting on the recorder.