NatCorder
Search…
JPGRecorder
class NatSuite.Recorders.JPGRecorder : IMediaRecorder
NatCorder includes the JPGRecorder for recording *.jpg image sequences. This is useful for frame analysis and post-process editing workflows.
This recorder is not thread-safe, and as such it is not fully compliant with the IMediaRecorder interface.

Creating the Recorder

1
/// <summary>
2
/// Create a JPG recorder.
3
/// </summary>
4
/// <param name="width">Image width.</param>
5
/// <param name="height">Image height.</param>
6
JPGRecorder (int width, int height);
Copied!
You must specify the image width and height ahead of time.

Image Size

1
/// <summary>
2
/// Image size.
3
/// </summary>
4
(int width, int height) frameSize { get; }
Copied!
Refer to the Frame Size section of the IMediaRecorder interface for more information.

Committing Frames

1
/// <summary>
2
/// Commit a video pixel buffer for encoding.
3
/// The pixel buffer MUST have an RGBA8888 pixel layout.
4
/// </summary>
5
/// <param name="pixelBuffer">Pixel buffer containing video frame to commit.</param>
6
/// <param name="timestamp">Not used.</param>
7
void CommitFrame<T> (T[] pixelBuffer, long timestamp = ...) where T : unmanaged;
Copied!
Refer to the Committing Video Frames section of the IMediaRecorder interface for more information.
The JPGRecorder does not use timestamps on committed frames.
The JPGRecorder does not support committing audio frames. Committing audio frames is a null operation.

Finishing Recording

1
/// <summary>
2
/// Finish writing and return the path to the recorded media file.
3
/// </summary>
4
Task<string> FinishWriting ();
Copied!
Refer to the Finishing Recording section of the IMediaRecorder interface for more information.
The JPGRecorder will return the path to a directory containing all the images in the sequence.
Last modified 1yr ago