IRecordingClient
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.
This page is reference (facts only). For a walkthrough with a complete sample, see the Recording guide.
Properties
| Property | Type | Access | Description |
|---|---|---|---|
IsRecording | bool | get | Whether the system is recording, whoever started it. |
Method summary
| Method | Returns | |
|---|---|---|
StartRecordingAsync | Task | |
StopRecordingAsync | Task |
→ Full descriptions in Method details below.
Events
Standard .NET events (EventHandler<T>): subscribe with +=, unsubscribe with -=. They are raised on a background thread.
| Event | Args | Raised when |
|---|---|---|
RecordingStateChanged | RecordingStateEventArgs | Raised when recording starts or stops, whoever started it. Raised on a background thread. Checked about once a second. |
Method details
StartRecordingAsync
Task StartRecordingAsync(RecordingOptions options, CancellationToken cancellationToken = default);
Starts recording tracking data and, from the chosen cameras, video.
RecordingOptions.Name is empty or not a valid folder name.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.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
Task StopRecordingAsync(CancellationToken cancellationToken = default);
Stops the recording, whoever started it. Does nothing if nothing is recording.
Stops the recording whoever started it — including one started from Mocap Studio or another app.
Related types
Small types used by this interface, documented here.
RecordingOptions
record · sealedpublic sealed record RecordingOptions
Options for IRecordingClient.StartRecordingAsync.
Video is recorded at each camera's own resolution and frame rate.
| Property | Type | Access | Default | Description |
|---|---|---|---|---|
Name | string | get · init | — | Required. The recording's name, also the name of its folder on the servers. |
CameraIds | IReadOnlyList<string> | get · init | [] | The cameras to record video from, by CameraInfo.Id. Empty = tracking data only, no video. |
RecordingStateEventArgs
class · sealedpublic sealed class RecordingStateEventArgs : EventArgs
Data for IRecordingClient.RecordingStateChanged.
| Property | Type | Access | Description |
|---|---|---|---|
IsRecording | bool | get | Whether the system is recording now. |
Constructor
public RecordingStateEventArgs(bool isRecording);
Creates the event data.
See also
- Recording guide — walkthrough with a complete, compiled sample
- Class index — every AR51.Net type
- Data conventions, threading and errors