Activity Recording
Once camera and subject calibration are complete, you're ready to record movement activities. Once processing is done, you can retrieve raw data like joint angles, marker data, or videos.
Note: Camera positions must remain fixed after calibration. If you need to reposition cameras, you'll need to recalibrate.
Recording
Start Recording
Pass any descriptive string as the activity name — use something that helps identify the attempt later (e.g. cmj, squat, cut).
- Swift
- TypeScript
let activity = try await service.startRecording(activityNamed: "cmj", in: session)
const activity = await service.startRecording("cmj", session);
During Recording
- The subject performs the movement
- Ensure the subject remains within the field of view of at least two cameras
- See the documentation for activity-specific recommendations
Stop Recording
- Swift
- TypeScript
try await service.stopRecording(session)
await service.stopRecording(session);
Checking Processing Status
After stopping, videos are uploaded and processed automatically. Processing may take some time (2-5 minutes), so you can check the status periodically.
- Swift
- TypeScript
let status = try await service.activityStatus(for: activity)
switch status {
case .uploading(let uploaded, let total):
print("Uploading: \(uploaded)/\(total) videos")
case .processing:
print("Processing video...")
case .ready:
print("Ready for analysis!")
case .failed:
print("Processing failed")
}
let status = await service.activityStatus(activity);
while (status.type === "uploading" || status.type === "processing") {
if (status.type === "uploading") {
console.log(`Uploading: ${status.uploaded}/${status.total} videos`);
} else {
console.log("Processing video...");
}
await new Promise(resolve => setTimeout(resolve, 2000));
status = await service.activityStatus(activity);
}
if (status.type === "ready") {
console.log("Ready for analysis!");
} else if (status.type === "failed") {
console.log("Processing failed");
}
Retrieving raw data
Once the activity status is ready, you can retrieve the raw motion data, including joint kinematics, marker trajectories, and videos.
If a built-in analysis module is available for your activity, you can also launch an advanced analysis to generate key metrics and a detailed report (see Activity Analysis).
- Swift
- TypeScript
// Download kinematics (MOT format) and marker trajectories (TRC format)
let resultData = await service.motionData(
ofType: [.kinematics(.mot), .markers(.trc)],
for: activity
)
for result in resultData {
switch result.type {
case .kinematics(.mot):
// result.data contains the kinematics file in OpenSim MOT format
print("Kinematics MOT: \(result.data.count) bytes")
case .markers(.trc):
// result.data contains the marker trajectories in TRC format
print("Markers TRC: \(result.data.count) bytes")
default:
break
}
}
// Download raw videos
let videos = await service.videos(for: activity, version: .raw)
print("Downloaded \(videos.count) video(s)")
// Download kinematics (MOT format) and marker trajectories (TRC format)
const resultData = await service.motionDataForActivity(
activity,
["kinematics_mot", "markers_trc"]
);
for (const result of resultData) {
if (result.type === "kinematics_mot") {
// result.data contains the kinematics file in OpenSim MOT format
console.log(`Kinematics MOT: ${result.data.length} bytes`);
} else if (result.type === "markers_trc") {
// result.data contains the marker trajectories in TRC format
console.log(`Markers TRC: ${result.data.length} bytes`);
}
}
// Download raw videos
const videos = await service.videosForActivity(activity, "raw");
console.log(`Downloaded ${videos.length} video(s)`);
Tips
- Clothing: Wear fitted clothing with good contrast to improve accuracy
- Background: Use a plain, uncluttered background for better results.
- Duration: Record only what you need — typically 5-30 seconds — to ensure fast upload and processing
See our Best Practices Guide for more details.
Troubleshooting
Trial trimmed too short or failed:
- Camera fields of view may not overlap sufficiently—reposition cameras so at least two capture the subject throughout the activity
- If the subject is visible for less than 2 seconds, the trial may fail
Inaccurate kinematics:
- Segment occlusion: Each body segment must be visible by at least 2 cameras at all times — reposition and recalibrate if needed
- Camera angles too similar: Aim for 40-90° separation between cameras
- Subject too far from cameras: Move the subject closer if possible
- Poor contrast: Improve clothing and background contrast, especially at the feet
- Camera sync issues: Have the subject perform a sync punch at the start of the trial
- Bad camera calibration: Recalibrate the cameras if necessary.
See our Troubleshooting and Activity-Specific Recommendations guides for more help.
Next Steps
Once the activity status is ready, proceed to Activity Analysis.