Robot learning

Robot Learning Data Formats: LeRobot vs RLDS vs HDF5 vs MCAP

How each format stores an episode, which training code expects which, what raw video costs in storage, and a checklist for handing a dataset over.

•Robot learning•RoboPilots
  • robot learning data
  • LeRobot
  • RLDS
  • HDF5
  • MCAP
  • teleoperation data
  • datasets

Most robot learning data ends up in one of four containers: LeRobotDataset (Parquet plus MP4 video), RLDS (episodes of steps in TFRecord, read through TensorFlow Datasets), HDF5 (a general container that ACT and robomimic each lay out their own way) or MCAP (the default log format of ROS 2 bags). They are less rivals than tools for different stages. This guide shows how each one stores an episode, which training code expects which, what the choice costs in storage, and how to decide before the first episode is recorded.

What are the four formats?

LeRobotDataset v3.0

The format of Hugging Face's LeRobot. Low-dimensional signals such as joint states, actions and timestamps go into Apache Parquet. Camera frames are encoded into MP4, sharded per camera. A meta folder holds the schema and frame rate (info.json), normalization statistics (stats.json), language task descriptions (tasks.parquet) and per-episode offsets. Version 3.0 packs many episodes into each file and is included in lerobot 0.4.0 and later.

RLDS

Reinforcement Learning Datasets, from Google Research. An episode holds metadata and a sequence of steps. Every step must carry is_first and is_last, and usually carries observation, action, reward, is_terminal and discount. Storage is TFRecord through TensorFlow Datasets. Open X-Embodiment represents each of its datasets as a sequence of episodes in the RLDS format, loaded with tfds.load.

HDF5

A general scientific container, not a robotics standard, so the layout is whatever the writing code decided. Two layouts are common. The ACT recording script writes one episode_N.hdf5 per episode with /observations/qpos, /observations/qvel, /observations/images/<camera> and /action. robomimic puts every demonstration in one file under a data group (demo_0, demo_1 and so on) with actions, rewards, dones and obs, plus a mask group for train and validation splits.

MCAP

An open source container for timestamped, multimodal log data, and the default storage plugin of rosbag2 (the other is sqlite3). MCAP stores message schemas alongside the data, has an optional index for fast reads, writes append-only, and records Protobuf, CDR, ROS, JSON and other serializations. Readers and writers exist in C++, Go, Python, Rust, Swift and TypeScript.

Which format does your training code expect?

Start from the policy and the library you will train with. The format follows from that choice, not the other way around.

lerobot

LeRobotDataset. lerobot-record writes it directly, and lerobot-train reads it for ACT and for the vision-language-action models the LeRobot docs name, such as Pi0, Pi0.5 and SmolVLA. Datasets can also be streamed from the Hub during training without downloading them first.

Open X-Embodiment mixes and TFDS pipelines

RLDS. If you plan to co-train with those datasets or contribute to them, an RLDS export saves a conversion later.

The original ACT code or robomimic baselines

Their own HDF5 layouts. Note that the two are not the same: one file per episode in ACT, one file per dataset in robomimic.

ROS 2 robots and vehicles

MCAP, written by ros2 bag, as the raw record of every topic. The learning pipelines above read episodes rather than topics, so an MCAP log is normally exported into one of the episode formats before training.

How do they compare side by side?

Unit of storage

LeRobot: many episodes per Parquet and MP4 shard, split by metadata. RLDS: episodes of steps. HDF5: one episode per file (ACT) or all demonstrations in one file (robomimic). MCAP: timestamped messages on channels.

Camera data

LeRobot: encoded MP4 per camera. ACT HDF5: raw uint8 arrays, 480 x 640 x 3 per frame in the script. MCAP: whatever message type the camera driver publishes.

Schema

LeRobot: meta/info.json with feature names, shapes and types. RLDS: step fields plus optional episode metadata such as episode_id and agent_id. HDF5: dataset names and attributes (robomimic stores env_args as JSON). MCAP: the message schemas travel in the file.

Reading at scale

LeRobot: streaming from the Hub, and an optional LanceDB backend for random access from object storage. MCAP: the index makes seeking fast. HDF5: chunked reads.

What does raw video cost? A worked example

Camera frames are the bulk of any dataset, and the format decides whether they are compressed. The ACT script stores each frame as a raw 480 x 640 x 3 array of bytes: 921,600 bytes per frame per camera, with no compression set when the datasets are created. Take an illustrative setup: two cameras, 30 frames per second and 60-second episodes, which are the LeRobot recording defaults for episode length. One episode is 1,800 frames x 2 cameras x 921,600 bytes, about 3.3 GB of image data. Fifty episodes, the LeRobot tutorial's suggested first dataset, come to about 166 GB.

The same footage in LeRobotDataset is encoded as MP4, which is why a LeRobot dataset of that size is practical to push to the Hub and stream during training. HDF5 can compress too; the ACT script simply does not turn it on. If you keep raw arrays, budget the disk and the transfer time before the collection starts, not after.

Decide the format with the training code in hand. Converting a dataset is a script; re-recording it means paying for the operator time again.

Can you convert between formats?

Yes, with care. LeRobot ships a converter from its own v2.1 layout to v3.0 that merges per-episode files into shards and rewrites the episode offsets. Between families, from HDF5 or MCAP into LeRobot or RLDS, check the lerobot repository and the dataset's own tooling for a maintained script before writing one. Whatever you use, verify the result: replay a few episodes on the robot, compare frame counts and timestamps, and confirm the action and state ordering survived.

How do you choose before recording?

Training with lerobot

Record LeRobotDataset directly and keep the same camera names and resolution from recording to deployment: a policy expects what it was trained on.

Co-training with Open X-Embodiment data

Plan an RLDS export from day one, with step fields mapped once and documented.

Reproducing ACT or robomimic results

Match their HDF5 layout exactly, including dataset names and attributes.

A ROS 2 robot, a vehicle or many sensor topics

Keep MCAP as the untouched raw record, and export training episodes from it.

More than one of the above

Keep one raw record and export each format from it with a versioned script, rather than recording twice.

What should a dataset handoff include?

Whoever trains on the data was usually not in the room when it was recorded. A handoff that answers these questions saves guessing.

Format and version, for example LeRobotDataset v3.0 with the codebase version from meta/info.json, or the exact HDF5 layout.
Camera names, resolutions and frame rate, and where each camera was mounted.
State and action definitions: joint order, units, gripper convention and control frequency.
Task descriptions and the protocol operators followed for each task.
The episode list, including which episodes were rejected and why.
Normalization statistics, or the script that computes them.
The conversion script and its version, if any format was exported from another.

For how the episodes get recorded in the first place, read our guide to teleoperation data collection for robot learning and the step-by-step LeRobot dataset guide. To size the collection, see how many demonstrations a robot policy needs. Bimanual setups have their own notes on the ALOHA Stationary page, and vehicle fleets on remote pilots for autonomous vehicles.

RoboPilots trains a dedicated group of operators on your own robot and task protocol, and delivers the data as LeRobot, RLDS or HDF5, or as MCAP and ROS 2 bags for vehicles. A one-week trial sets a clean-episodes-per-operator-hour baseline before a longer collection is quoted.

Frequently asked questions

What is the difference between LeRobot and RLDS?
LeRobotDataset stores low-dimensional signals in Parquet and camera frames as MP4, with metadata describing episodes, and is read by the lerobot library in PyTorch. RLDS stores episodes as sequences of steps in TFRecord through TensorFlow Datasets, and is the format of Open X-Embodiment. Pick the one your training code reads, and export the other only if you need it.
Is HDF5 a standard format for robot learning?
HDF5 is a general container, so there is no single robot layout. The ACT code writes one file per episode with observations and actions as named datasets, while robomimic keeps every demonstration in one file under a data group. If you reproduce one of those projects, match its layout exactly, including dataset names and attributes.
Why use MCAP if training code does not read it?
MCAP is the default storage of ROS 2 bags and records every topic with its schema, so it is the faithful raw record of what the robot saw and did. Keep it untouched, and export training episodes from it into LeRobot, RLDS or HDF5 with a versioned script. If the export has a bug, you can fix it and run it again.
How much storage does robot demonstration video need?
Uncompressed, a lot. A raw 480 x 640 color frame is 921,600 bytes, so two cameras at 30 frames per second for a 60-second episode come to about 3.3 GB, and 50 episodes to about 166 GB. Encoded video, as LeRobotDataset uses, is far smaller. Check whether your format compresses before you start recording.
Can I convert a dataset from one format to another?
Yes. LeRobot ships a converter from its v2.1 layout to v3.0, and other conversions are scripts. Check for a maintained script before writing your own, and verify the result by replaying a few episodes, comparing frame counts and timestamps, and confirming that joint order and action conventions survived the conversion.
Book a RoboPilot

Humanoid

Whole-body teleoperation for real tasks, recorded as training data.

No commitment. Your quote arrives within one business day.

Questions about this article?

contact@robopilots.ai