NRSDKApiForUnity
Classes
RecordNRVideoCapture

Inherits IDisposable.

Classes

struct  VideoCaptureResult
 

Public Types

enum  CaptureResultType { Success = 0 , UnknownError = 1 }
 
enum  AudioState { MicAudio = 0 , ApplicationAudio = 1 , ApplicationAndMicAudio = 2 , None = 3 }
 

Public Member Functions

 NRVideoCapture ()
 
FrameCaptureContext GetContext ()
 
void Dispose ()
 
void StartRecordingAsync (string filename, OnStartedRecordingVideoCallback onStartedRecordingVideoCallback)
 
void StartRecordingAsync (string filename, OnStartedRecordingVideoCallback onStartedRecordingVideoCallback, float volumeFactorMic, float volumeFactorApp)
 
void StartVideoModeAsync (CameraParameters setupParams, OnVideoModeStartedCallback onVideoModeStartedCallback, bool autoAdaptBlendMode=false)
 
void StopRecordingAsync (OnStoppedRecordingVideoCallback onStoppedRecordingVideoCallback)
 
void StopVideoModeAsync (OnVideoModeStoppedCallback onVideoModeStoppedCallback)
 
delegate void OnStartedRecordingVideoCallback (VideoCaptureResult result)
 
delegate void OnVideoCaptureResourceCreatedCallback (NRVideoCapture captureObject)
 
delegate void OnVideoModeStartedCallback (VideoCaptureResult result)
 
delegate void OnVideoModeStoppedCallback (VideoCaptureResult result)
 
delegate void OnStoppedRecordingVideoCallback (VideoCaptureResult result)
 

Static Public Member Functions

static void CreateAsync (bool showHolograms, OnVideoCaptureResourceCreatedCallback onCreatedCallback)
 
static IEnumerable< int > GetSupportedFrameRatesForResolution (Resolution resolution)
 

Properties

static IEnumerable< Resolution > SupportedResolutions [get]
 
bool IsRecording [get]
 
Texture? PreviewTexture [get]
 

Detailed Description

Records a video from the MR images directly to disk. MR images comes from rgb camera or rgb camera image and virtual image blending. The final video recording will be stored on the file system in the MP4 format.

Member Enumeration Documentation

◆ AudioState

Specifies what audio sources should be recorded while recording the video.

Enumerator
MicAudio 

Only include the mic audio in the video recording.

ApplicationAudio 

Only include the application audio in the video recording.

None 

Do not include any audio in the video recording.

◆ CaptureResultType

Contains the result of the capture request.

Enumerator
Success 

Specifies that the desired operation was successful.

UnknownError 

Specifies that an unknown error occurred.

Member Function Documentation

◆ CreateAsync()

static void NRKernal.Record.NRVideoCapture.CreateAsync ( bool  showHolograms,
OnVideoCaptureResourceCreatedCallback  onCreatedCallback 
)
static

Creates an asynchronous.

Parameters
showHologramsTrue to show, false to hide the holograms.
onCreatedCallbackThe on created callback.

◆ GetContext()

FrameCaptureContext NRKernal.Record.NRVideoCapture.GetContext ( )

Gets the context.

Returns
The context.

◆ GetSupportedFrameRatesForResolution()

static IEnumerable< int > NRKernal.Record.NRVideoCapture.GetSupportedFrameRatesForResolution ( Resolution  resolution)
static

Returns the supported frame rates at which a video can be recorded given a resolution.

Parameters
resolutionA recording resolution.
Returns
The frame rates at which the video can be recorded.

◆ OnStartedRecordingVideoCallback()

delegate void NRKernal.Record.NRVideoCapture.OnStartedRecordingVideoCallback ( VideoCaptureResult  result)

Called when the web camera begins recording the video.

Parameters
resultIndicates whether or not video recording started successfully.

◆ OnStoppedRecordingVideoCallback()

delegate void NRKernal.Record.NRVideoCapture.OnStoppedRecordingVideoCallback ( VideoCaptureResult  result)

Called when the video recording has been saved to the file system.

Parameters
resultIndicates whether or not video recording was saved successfully to the file system.

◆ OnVideoCaptureResourceCreatedCallback()

delegate void NRKernal.Record.NRVideoCapture.OnVideoCaptureResourceCreatedCallback ( NRVideoCapture  captureObject)

Called when a VideoCapture resource has been created.

Parameters
captureObjectThe VideoCapture instance.

◆ OnVideoModeStartedCallback()

delegate void NRKernal.Record.NRVideoCapture.OnVideoModeStartedCallback ( VideoCaptureResult  result)

Called when video mode has been started.

Parameters
resultIndicates whether or not video mode was successfully activated.

◆ OnVideoModeStoppedCallback()

delegate void NRKernal.Record.NRVideoCapture.OnVideoModeStoppedCallback ( VideoCaptureResult  result)

Called when video mode has been stopped.

Parameters
resultIndicates whether or not video mode was successfully deactivated.

◆ StartRecordingAsync() [1/2]

void NRKernal.Record.NRVideoCapture.StartRecordingAsync ( string  filename,
OnStartedRecordingVideoCallback  onStartedRecordingVideoCallback 
)

Starts recording asynchronous.

Parameters
filenameFilename of the file.
onStartedRecordingVideoCallbackThe on started recording video callback.

◆ StartRecordingAsync() [2/2]

void NRKernal.Record.NRVideoCapture.StartRecordingAsync ( string  filename,
OnStartedRecordingVideoCallback  onStartedRecordingVideoCallback,
float  volumeFactorMic,
float  volumeFactorApp 
)

Starts recording asynchronous.

Parameters
filenameFilename of the file.
onStartedRecordingVideoCallbackThe on started recording video callback.
volumeFactorMicThe volume factor of mic.
volumeFactorAppThe volume factor of application.

◆ StartVideoModeAsync()

void NRKernal.Record.NRVideoCapture.StartVideoModeAsync ( CameraParameters  setupParams,
OnVideoModeStartedCallback  onVideoModeStartedCallback,
bool  autoAdaptBlendMode = false 
)

Starts video mode asynchronous.

Parameters
setupParamsOptions for controlling the setup.
onVideoModeStartedCallbackThe on video mode started callback.
autoAdaptBlendModeAuto adaption for BlendMode based on supported feature on current device.

◆ StopRecordingAsync()

void NRKernal.Record.NRVideoCapture.StopRecordingAsync ( OnStoppedRecordingVideoCallback  onStoppedRecordingVideoCallback)

Stops recording asynchronous.

Parameters
onStoppedRecordingVideoCallbackThe on stopped recording video callback.

◆ StopVideoModeAsync()

void NRKernal.Record.NRVideoCapture.StopVideoModeAsync ( OnVideoModeStoppedCallback  onVideoModeStoppedCallback)

Stops video mode asynchronous.

Parameters
onVideoModeStoppedCallbackThe on video mode stopped callback.

Property Documentation

◆ IsRecording

bool NRKernal.Record.NRVideoCapture.IsRecording
get

Indicates whether or not the VideoCapture instance is currently recording video.

True if this object is recording, false if not.

◆ PreviewTexture

Texture? NRKernal.Record.NRVideoCapture.PreviewTexture
get

Gets the preview texture.

The preview texture.

◆ SupportedResolutions

IEnumerable<Resolution> NRKernal.Record.NRVideoCapture.SupportedResolutions
staticget

A list of all the supported device resolutions for recording videos.

The supported resolutions.