JPEGRecorder

class NatML.Recorders.JPEGRecorder : IMediaRecorder

The JPEGRecorder records *.jpg image sequences. This is useful for frame analysis and post-process editing workflows.

The JPEGRecorder is not supported on WebGL.

Creating the Recorder

/// <summary>
/// Create a JPEG image sequence recorder.
/// </summary>
/// <param name="width">Image width.</param>
/// <param name="height">Image height.</param>
JPEGRecorder (int width, int height);

You must specify the image width and height ahead of time.

Image Size

/// <summary>
/// Image size.
/// </summary>
(int width, int height) frameSize { get; }

Refer to the Frame Size section of the IMediaRecorder interface for more information.

Committing Frames

/// <summary>
/// Commit a video pixel buffer for encoding.
/// The pixel buffer MUST have an RGBA8888 pixel layout.
/// </summary>
/// <param name="pixelBuffer">Pixel buffer containing video frame to commit.</param>
/// <param name="timestamp">Not used.</param>
void CommitFrame<T> (T[] pixelBuffer, long timestamp = ...) where T : unmanaged;

Refer to the Committing Video Frames section of the IMediaRecorder interface for more information.

The JPEGRecorder does not use timestamps on committed frames.

The JPEGRecorder does not support committing audio frames. Committing audio frames is a null operation.

Finishing Recording

/// <summary>
/// Finish writing and return the path to the recorded media file.
/// </summary>
Task<string> FinishWriting ();

Refer to the Finishing Recording section of the IMediaRecorder interface for more information.

The JPEGRecorder will return the path to a directory containing all the images in the sequence.

Last updated