- Create a recorder — Create a
TopicRecorderand choose a compression algorithm - Register channels — Call
recorder.record(sub)to register subscription channels, supporting device and global resources in the same session - Start recording — Call
await recorder.start(path)to begin recording, which returns aRecordingHandlefor control
For runnable code, see the Examples at the bottom of this page.
Compression Options
Choose a compression algorithm with thecompression parameter when creating TopicRecorder:
Message Timestamps
Each message in the MCAP file carries two time fields.log_time is when the host received the frame. publish_time comes from the frame’s FrameHeader timestamp_us, converted to nanoseconds, so it preserves the event time on the device. Keeping the two apart lets downstream tools align streams on publish_time without transport and queuing latency for messages that carry a valid device-side timestamp. Messages that fall back to the host receive time are not covered by this alignment.
Resources without a FrameHeader (such as plain scalar parameters) and frames whose timestamp_us is 0 fall back to the host receive time for publish_time. The meaning of timestamp_us depends on the time sync state. See Time Synchronization.
Recording Global Resources
Cross-device merged global resources (such as coordinate transforms) can also be recorded, mixed with device resources:Pause and Resume
Pause and resume recording at any time. Device data continues to stream while paused, but nothing is written to the file.Episode Switching
Callstart() multiple times on the same TopicRecorder to switch output files without re-registering channels. Use this to split a continuous capture session into separate recording segments:
Recording Monitoring
Monitor data quality metrics in real time during recording:channels, see Common Data Types — QualityMetrics.
Quality Alerts
The recording engine includes a built-in SPC alert mechanism that triggers when quality metrics exceed thresholds for a sustained period:Recording Status
Monitor the runtime state of a recording:Recording Summary
handle.stop() returns a RecordingSummary with recording statistics:
Examples
Demonstrates pause/resume, recording monitoring, episode switching, and recording summary:Interface List
The recording engine ships in the Python API only, so the code samples on this page are Python only. A C program can reach the same frames through
wuji_<device>_subscribe_<stream>(), but the on-disk format, quality statistics, and episode switching are up to the application. See the C Interface Reference for the subscription APIs.