Skip to main content

IRecordingClient

interface thread-safe
namespace AR51.Net;

public interface IRecordingClient

Records camera video and tracking data on the AR 51 servers. Use it through IAR51Client.Recording.

Recordings are saved on the servers, in a folder named after the recording. IsRecording follows the system live, whoever started the recording. All members are safe to use from any thread.

How-to

This page is reference (facts only). For a walkthrough with a complete sample, see the Recording guide.

Properties​

PropertyTypeAccessDescription
IsRecordingboolgetWhether the system is recording, whoever started it.

Method summary​

→ Full descriptions in Method details below.

Events​

Standard .NET events (EventHandler<T>): subscribe with +=, unsubscribe with -=. They are raised on a background thread.

EventArgsRaised when
RecordingStateChangedRecordingStateEventArgsRaised when recording starts or stops, whoever started it. Raised on a background thread. Checked about once a second.

Method details​

StartRecordingAsync​

method
Task StartRecordingAsync(RecordingOptions options, CancellationToken cancellationToken = default);

Starts recording tracking data and, from the chosen cameras, video.

Parameters
optionsRecordingOptionsThe recording's name and cameras.
cancellationTokenCancellationTokenCancels the request. Optional.
ReturnsTaskA task that completes when every chosen camera and the tracking data are recording.
Throws
ArgumentExceptionRecordingOptions.Name is empty or not a valid folder name.
AR51ExceptionA recording is already running, started by this or another app, or a camera does not exist or failed to start (AR51ErrorCode.Rejected), or a server could not be reached. A running recording is never touched, and nothing is left half-started: the parts that did start are stopped again.
Example
await ar51.Recording.StartRecordingAsync(new RecordingOptions
{
Name = "take-01",
CameraIds = new[] { camera.Id }, // empty = tracking data only
});
await Task.Delay(TimeSpan.FromSeconds(5));
await ar51.Recording.StopRecordingAsync();

StopRecordingAsync​

method
Task StopRecordingAsync(CancellationToken cancellationToken = default);

Stops the recording, whoever started it. Does nothing if nothing is recording.

Parameters
cancellationTokenCancellationTokenCancels the request. Optional.
ReturnsTaskA task that completes when the servers have stopped recording.
Throws
AR51ExceptionA server could not be reached.
Affects every app using the system

Stops the recording whoever started it — including one started from Mocap Studio or another app.

Small types used by this interface, documented here.

RecordingOptions​

record · sealed
public sealed record RecordingOptions

Options for IRecordingClient.StartRecordingAsync.

note

Video is recorded at each camera's own resolution and frame rate.

PropertyTypeAccessDefaultDescription
Namestringget · init—Required. The recording's name, also the name of its folder on the servers.
CameraIdsIReadOnlyList<string>get · init[]The cameras to record video from, by CameraInfo.Id. Empty = tracking data only, no video.

RecordingStateEventArgs​

class · sealed
public sealed class RecordingStateEventArgs : EventArgs

Data for IRecordingClient.RecordingStateChanged.

PropertyTypeAccessDescription
IsRecordingboolgetWhether the system is recording now.
Constructor
public RecordingStateEventArgs(bool isRecording);

Creates the event data.

See also​

Was this page helpful?