The delivery file: topics, units and frames
Spec version: 1
This page describes the file a customer downloads for one job. It states every topic the file can hold, with its units, its axes, its coordinate frame and its clock. The service writes the file and refuses to write a topic that is not on this page.
What you download
One MCAP file per job. MCAP is a container of timestamped messages, grouped into named topics. Every message is a protobuf message, and the file carries the protobuf description of each schema, so an MCAP reader with protobuf support decodes it with no extra files.
The job's result manifest comes with the file. The API returns it as the job's result. It gives the file's size in bytes, its sha256 and its md5, the status of each output, and the output frame described below.
The file holds the whole video. It is never cut into pieces.
The output frame
Every result refers to the pictures the service made from your video, not to your video's own pictures. These pictures and their clock are the output frame.
| Your request held | Pictures in the file | What leaves |
|---|---|---|
| Lens values | Undistorted to an ideal pinhole camera, cropped to 16:9, at most 1920 by 1080 | Video, masks, camera topics, and depth and trajectory when they completed |
| No lens values | Your aspect ratio, scaled down until the long side is at most 1920 and the short side at most 1080 | Video and masks only |
The manifest's output_frame states which row applies (path is lens or blur_only) and gives width, height and frames.
Frames. A video faster than 55 frames per second loses whole frames: a frame is kept once it is at least one 55th of a second after the last kept frame. A 60 fps video becomes 30 fps. A 50 fps video stays at 50 fps. No frame is invented, and every kept frame keeps its own time.
Clock. Message times are in nanoseconds. They are not wall-clock times. The first frame has the time base_time_ns, and every other message keeps its distance from that frame. To get the time of a message on your video's own clock, use:
time in your video = source_start_ns + (message time - base_time_ns)
source_start_ns is the presentation time of the first frame in your video file. Both values are in the manifest's output_frame, together with first_frame_ns and last_frame_ns.
Coordinate frames
All frames are right-handed. Lengths are in metres.
| Frame id | What it is | Axes |
|---|---|---|
color0 | The camera's optical frame. Pixels and depth refer to it. | x to the right of the picture, y down, z forward along the optical axis |
camera | The camera's body frame. The trajectory gives its pose. | x forward, y to the left, z up |
imu0 | The frame of your IMU values. | The axis order that your IMU file, or the IMU stream inside your video, stores |
world | The fixed frame of the trajectory. | See Trajectory |
/camera/tf_static links camera to color0 and camera to imu0.
Topics
"Per frame" means one message for every video frame, stamped with that frame's time. The same time is inside the message as well: in its timestamp field, or in the timestamp of each transform.
| Topic | Schema | How often | Leaves when |
|---|---|---|---|
/camera/color/0/image | foxglove.CompressedVideo | per frame | always |
/pii/mask/0 | foxglove.CompressedImage | per frame | always |
/pii/labels | microagi.SegmentationLabels | once | always |
/camera/color/0/info | foxglove.CameraCalibration | once | lens values were given |
/camera/tf_static | foxglove.FrameTransforms | once | lens values were given |
/camera/imu/0/accel/info | microagi.ImuInfo | once | IMU data was given |
/camera/imu/0/accel/sample | foxglove.PoseInFrame | per IMU sample | IMU data was given |
/camera/imu/0/gyro/info | microagi.ImuInfo | once | IMU data was given |
/camera/imu/0/gyro/sample | foxglove.PoseInFrame | per IMU sample | IMU data was given |
/camera/relative_depth/0/image | foxglove.CompressedImage | per frame | depth completed |
/camera/relative_depth/0/info | foxglove.CameraCalibration | once | depth completed |
/camera/relative_depth/0/health | microagi.Health | per frame | depth completed |
/camera/relative_depth/0/unit_of_depth_in_mm | microagi.UnitOfDepthInMM | once | depth completed |
/slam/tf | foxglove.FrameTransforms | per frame | trajectory completed |
/slam/health | microagi.Health | per frame | trajectory completed |
The file also holds two MCAP metadata records: delivery_file, with this page's spec_version, and slam_world when the trajectory completed. Each topic has one channel. A message's publish time equals its log time.
Video
/camera/color/0/image is H.265 video with the personal data blurred in the pictures themselves.
formatish265andframe_idiscolor0.dataholds exactly one picture, in Annex B form with 4-byte start codes.- The video has no B-frames, so the messages are in display order.
- A keyframe comes at least every 250 frames, and each keyframe repeats the parameter sets.
- The pixel format is 4:2:0 with 8 bits.
A pixel is blurred when the frame's mask marks it with any class other than 0. The blur is a box blur 51 pixels wide. Outside the mask, the brightness of every pixel keeps its value until the video is encoded again. Colour is stored once for each block of 2 by 2 pixels, so a block with one marked pixel gets blurred colour as a whole.
Masks
/pii/mask/0 holds one PNG per frame. It is one channel of 8 bits.
- A full mask has the size of the video frame. The value of a pixel is the class found there, and 0 means nothing was found.
- A PNG of 1 by 1 pixel with the value 0 means that nothing was found in that frame.
/pii/labels maps each class number to its name. In this version:
| Value | Class |
|---|---|
| 0 | background |
| 1 | human face |
| 2 | human head |
| 3 | license plate |
| 4 | ID card |
| 5 | passport |
| 6 | credit card |
| 7 | handwritten text |
| 8 | paper document |
| 9 | address label on package |
| 10 | screen |
Read the names from /pii/labels in your file. The table above can grow in a later version.
Camera
/camera/color/0/info describes the pictures of the output frame, not your camera's original pictures.
Kis in pixels: the focal length on the diagonal and the principal point at the centre of the picture.- The distortion model is
plumb_boband every distortion value is 0, because the pictures are already undistorted.
/camera/tf_static holds one transform, or two when IMU data was given. A transform maps a point in the child frame to the parent frame.
| Parent | Child | Value |
|---|---|---|
camera | color0 | A fixed rotation with no translation. It turns the optical axes into the body axes of the table above. |
camera | imu0 | That rotation combined with the IMU-to-camera transform you sent. Its translation is in metres. Present only with IMU data. |
IMU
The IMU topics hold the values you sent, moved onto the clock of the output frame.
- An accelerometer sample is specific force in metres per second squared. A gyroscope sample is in radians per second.
- The three values are in
pose.positionasx,yandz. The orientation of the message carries no information. - The axes keep the order that your IMU file, or the IMU stream inside your video, stores.
sample_ratein eachinfomessage is the measured rate in hertz. The noise fields are 0.- Samples from one second before the first frame to one second after the last frame are kept.
Depth
/camera/relative_depth/0/image holds one PNG per frame, with one channel of 16 bits. The word "relative" in the topic name is historical: the values are metric.
- The value of a pixel times
unit_in_mmis a distance in millimetres.unit_in_mmis in/camera/relative_depth/0/unit_of_depth_in_mmand is 1.0 in this version. - The distance is measured along the optical axis. It is the z coordinate of the point in
color0, not the length of the ray to the point. - 0 means no depth for that pixel. The largest value is 65,535, which is 65.535 metres with a unit of 1.0.
- The depth picture has a size of its own. For a 16:9 video it is 896 by 504 pixels, whatever the size of the video.
/camera/relative_depth/0/infogivesKfor the depth picture, with no distortion andframe_idcolor0. Use it, not the colourK, to turn a depth pixel into a point.
/camera/relative_depth/0/health says whether each frame's depth is usable. valid is true for a normal frame. A frame that fails a quality check has valid false, and its depth picture is all zeros.
Trajectory
/slam/tf holds one transform per frame. Its parent is world and its child is camera.
- The transform places the camera's body frame in the world: a point in
camerabecomes a point inworld. - The translation is in metres. The rotation is a quaternion with the fields
x,y,zandw.
Read /slam/health together with every pose. When tracking is lost for a frame, /slam/tf repeats the last pose, and before the first pose it holds the identity. Only valid tells a repeated pose from a real one.
details.reason | valid | Meaning |
|---|---|---|
valid | true | The pose is usable. |
unanchored | true | The pose is usable, but the up direction was not measured. Do not use heights. |
loop_skipped | true | Local motion is usable. Positions far apart in time are not checked against each other. |
loop_unreconciled_tail | true | Usable, but revisited places still disagree after a correction. |
lost | false | No pose exists for the frame. Skip the frame. |
jump | false | The pose moves in a way the IMU did not measure, or farther in one step than a person moves. Skip the frame. |
The slam_world record
This metadata record says how to read the world frame.
| Field | Meaning |
|---|---|
levelled | true when gravity was found. Then z points up. When false, the world frame has no known up direction. |
frame_parent, frame_child | The frame ids of the transform: world and camera. |
child_basis | Always camera_body: the pose is of the body frame camera, as in the frame table above. |
yaw_gauge | How the horizontal direction was fixed. camera0_forward: x is the first frame's viewing direction, projected onto the horizontal plane. camera0_right: the camera looked almost straight down, so x is its right direction instead. none: the world is not levelled. |
datum_source | How the height z = 0 was chosen: from a measured floor (measured_floor, measured_floor_semantic_only) or from the operator's height (operator_height, operator_height_dominant). |
In a levelled world, y completes a right-handed frame with x and z. The horizontal origin is not moved to any special place.
The run summary
The channel of /slam/health carries a summary of the whole video as channel metadata.
| Field | Meaning |
|---|---|
frames | The number of frames. |
frames_invalid | The number of frames whose valid is false. |
frames_lost | The number of frames with the reason lost. |
frames_jump | The number of frames with the reason jump. |
run_loop | How the check of revisited places ended: confirmed, corrected (drift was found and fixed), reverted_with_evidence or skipped_no_evidence. |
imu_witness | ok when the poses were checked against the IMU. Any other value means that no frame was checked for jumps against the IMU. That is not the same as no jumps. |
What the file never holds
The service copies only the topics of the table above, each from the one input it belongs to and only under the schema the table states. It drops every other topic and every other metadata record. Of the channel metadata, only the run summary above is copied.
An output that did not complete leaves nothing in the file. The manifest says which outputs the file holds.