GIFRecorder
class NatML.Recorders.GIFRecorder : IMediaRecorder
The
GIFRecorder
records animated GIF images that loop forever.
Stopping a train with the Force, captured with NatCorder.
/// <summary>
/// Create a GIF recorder.
/// </summary>
/// <param name="width">Image width.</param>
/// <param name="height">Image height.</param>
/// <param name="frameDuration">Frame duration in seconds.</param>
GIFRecorder (int width, int height, float frameDuration);
The
width
and height
parameters determine the image dimensions in pixels. The frameDuration
parameter determines the amount of time each frame will display for in seconds; a good value to start with is 0.1 seconds./// <summary>
/// Image size.
/// </summary>
(int width, int height) frameSize { get; }
/// <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;
The
GIFRecorder
ignores all timestamps on committed frames. This is because the frameDuration
parameter overrides these timestamps.The
GIFRecorder
does not support committing audio frames. Committing audio frames is a null operation./// <summary>
/// Finish writing and return the path to the recorded media file.
/// </summary>
Task<string> FinishWriting ();
Last modified 11mo ago