// Docs

LeRobot writer

Write Refiner episode rows as LeRobot datasets

Use write_lerobot to write LeRobotRow or generic RoboticsRow values as a LeRobot dataset.

pipeline = (
    mdr.read_lerobot("hf://datasets/acme/raw")
    .map(mdr.robotics.motion_trim(threshold=0.001))
    .write_lerobot("hf://buckets/acme-robotics/trimmed")
)

Input requirements

Rows must be one of:

Row typeHow to get it
LeRobotRowread_lerobot(...)
RoboticsRowto_robot_rows(...) from HDF5, Zarr, files, or custom readers

Plain rows should be adapted before writing; see Converting to Robot Rows. If a generic RoboticsRow has no episode id, the writer generates one from the shard id and row position.

Output layout

The writer creates LeRobot-compatible data:

Output pathContent
data/chunk-.../file-...parquetFrame rows.
videos/<key>/chunk-.../file-...mp4Video streams when rows include videos.
meta/episodes/...Episode rows.
meta/tasks.parquetTask table.
meta/info.jsonDataset metadata.
meta/stats.jsonFeature statistics after reducer finalization.

Video behavior

The writer can remux compatible clipped videos instead of decoding and re-encoding them. It transcodes when required by format, clipping, stale stats, or writer options.

pipeline.write_lerobot(
    "hf://buckets/acme-robotics/output",
)

Performance knobs

OptionUse it for
data_files_size_in_mbTarget frame parquet file size.
video_files_size_in_mbTarget video file size.
codecVideo codec for transcoded videos. Defaults to mpeg4.
pix_fmtPixel format for transcoded videos. Defaults to yuv420p.
max_video_prepare_in_flightBound concurrent episode video preparation per worker. Defaults to 4.
quantile_binsAccuracy/cost tradeoff for video stats quantiles.
force_recompute_video_statsRecompute stats even when existing stats could be reused.