Tanoda
NatSuite.Recorders.MP4Recorder Class Reference

MP4 video recorder. More...

Inheritance diagram for NatSuite.Recorders.MP4Recorder:
NatSuite.Recorders.IMediaRecorder

Public Member Functions

 MP4Recorder (int width, int height, float frameRate, int sampleRate=0, int channelCount=0, int bitrate=(int)(960 *540 *11.4f), int keyframeInterval=3)
 Create an MP4 recorder. More...
 
 MP4Recorder (int width, int height, float frameRate, string filename, int sampleRate=0, int channelCount=0, int bitrate=(int)(960 *540 *11.4f), int keyframeInterval=3)
 
void CommitFrame< T > (T[] pixelBuffer, long timestamp)
 Commit a video pixel buffer for encoding. The pixel buffer MUST have an RGBA8888 pixel layout. More...
 
void CommitFrame (IntPtr nativeBuffer, long timestamp)
 Commit a video pixel buffer for encoding. The pixel buffer MUST have an RGBA8888 pixel layout. More...
 
void CommitSamples (float[] sampleBuffer, long timestamp)
 Commit an audio sample buffer for encoding. More...
 
Task< string > FinishWriting ()
 Finish writing and return the path to the recorded media file. More...
 
void CommitFrame< T > (T[] pixelBuffer, long timestamp)
 Commit a video pixel buffer for encoding. The pixel buffer MUST have an RGBA8888 pixel layout. More...
 
void CommitFrame (IntPtr nativeBuffer, long timestamp)
 Commit a video pixel buffer for encoding. The pixel buffer MUST have an RGBA8888 pixel layout. More...
 
void CommitSamples (float[] sampleBuffer, long timestamp)
 Commit an audio sample buffer for encoding. More...
 
Task< string > FinishWriting ()
 Finish writing and return the path to the recorded media file. More...
 

Public Attributes

int width
 Video size. More...
 
- Public Attributes inherited from NatSuite.Recorders.IMediaRecorder
int width
 Recording frame size. More...
 

Properties

int int height frameSize [get]
 
- Properties inherited from NatSuite.Recorders.IMediaRecorder
int int height frameSize [get]
 

Detailed Description

MP4 video recorder.

Definition at line 15 of file MP4Recorder.cs.

Constructor & Destructor Documentation

◆ MP4Recorder() [1/2]

NatSuite.Recorders.MP4Recorder.MP4Recorder ( int  width,
int  height,
float  frameRate,
int  sampleRate = 0,
int  channelCount = 0,
int  bitrate = (int) (960 * 540 * 11.4f),
int  keyframeInterval = 3 
)

Create an MP4 recorder.

Parameters
widthVideo width.
heightVideo height.
frameRateVideo frame rate.
sampleRateAudio sample rate. Pass 0 for no audio.
channelCountAudio channel count. Pass 0 for no audio.
bitrateVideo bitrate in bits per second.
keyframeIntervalKeyframe interval in seconds.

Definition at line 34 of file MP4Recorder.cs.

◆ MP4Recorder() [2/2]

NatSuite.Recorders.MP4Recorder.MP4Recorder ( int  width,
int  height,
float  frameRate,
string  filename,
int  sampleRate = 0,
int  channelCount = 0,
int  bitrate = (int) (960 * 540 * 11.4f),
int  keyframeInterval = 3 
)

Definition at line 42 of file MP4Recorder.cs.

Member Function Documentation

◆ CommitFrame()

void NatSuite.Recorders.MP4Recorder.CommitFrame ( IntPtr  nativeBuffer,
long  timestamp 
)

Commit a video pixel buffer for encoding. The pixel buffer MUST have an RGBA8888 pixel layout.

Parameters
nativeBufferPixel buffer in native memory to commit.
timestampFrame timestamp in nanoseconds.

Implements NatSuite.Recorders.IMediaRecorder.

Definition at line 66 of file MP4Recorder.cs.

◆ CommitFrame< T >()

void NatSuite.Recorders.MP4Recorder.CommitFrame< T > ( T[]  pixelBuffer,
long  timestamp 
)

Commit a video pixel buffer for encoding. The pixel buffer MUST have an RGBA8888 pixel layout.

Parameters
pixelBufferPixel buffer containing video frame to commit.
timestampFrame timestamp in nanoseconds.

Implements NatSuite.Recorders.IMediaRecorder.

Type Constraints
T :struct 

Definition at line 55 of file MP4Recorder.cs.

◆ CommitSamples()

void NatSuite.Recorders.MP4Recorder.CommitSamples ( float[]  sampleBuffer,
long  timestamp 
)

Commit an audio sample buffer for encoding.

Parameters
sampleBufferLinear PCM audio sample buffer, interleaved by channel.
timestampSample buffer timestamp in nanoseconds.

Implements NatSuite.Recorders.IMediaRecorder.

Definition at line 76 of file MP4Recorder.cs.

◆ FinishWriting()

Task< string > NatSuite.Recorders.MP4Recorder.FinishWriting ( )

Finish writing and return the path to the recorded media file.

Implements NatSuite.Recorders.IMediaRecorder.

Definition at line 84 of file MP4Recorder.cs.

Member Data Documentation

◆ width

int NatSuite.Recorders.MP4Recorder.width

Video size.

Definition at line 22 of file MP4Recorder.cs.

Property Documentation

◆ frameSize

int int height NatSuite.Recorders.MP4Recorder.frameSize
get

Implements NatSuite.Recorders.IMediaRecorder.

Definition at line 22 of file MP4Recorder.cs.


The documentation for this class was generated from the following file: