The Rerun Viewer and SDK have built-in support for opening many kinds of files, and can be extended to support any other file type without needing to modify the Rerun codebase itself.
The Viewer can load files in 3 different ways:
- via CLI arguments (e.g.
rerun myfile.jpeg), - using drag-and-drop,
- using the open dialog in the Rerun Viewer.
All these file loading methods support loading a single file, many files at once (e.g. rerun myfiles/*), or even folders.
The following data types have built-in support in the Rerun Viewer and SDK:
- Native Rerun files:
rrd,rbl - MCAP files:
mcap - Robot descriptions:
urdf,mjcf(MuJoCo models, also as.xml) - 3D models:
dae,gltf,glb,obj,ply,stl - Images:
avif,bmp,dds,exr,farbfeld,ff,gif,hdr,ico,jpeg,jpg,pam,pbm,pgm,png,ppm,tga,tif,tiff,webp - Depth images:
rvl - Video:
mp4 - Audio:
aac,flac,m4a,mp3,oga,ogg,wav - Point clouds:
ply - Parquet files:
parquet - Text files:
md,txt - LeRobot datasets:
directory
A .ply file can hold either a mesh or a point cloud, so it is listed twice: its header decides which one you get.
Point clouds may leave out z, in which case they load as 2D.
An .xml file is only loaded if it is a MuJoCo model, i.e. its root element is <mujoco>.
Files can also be opened from an HTTP URL (e.g. rerun https://demo.rerun.io/version/latest/examples/dna/data.rrd).
rrd and rbl files are streamed, while other supported formats are downloaded first and then loaded.
Logging file contents from the SDK
To log the contents of a file from the SDK you can use the log_file_from_path and log_file_from_contents methods (C++, Python, Rust) and the associated examples (C++, Python, Rust).
import sys
import rerun as rr
rr.init("rerun_example_log_file", spawn=True)
rr.log_file_from_path(sys.argv[1])
Formats without a built-in importer
For other formats, read the file with your own code and log the data, or write an importer so the Viewer can open the file directly.
CSV
There is no CSV importer.
Load the file with pandas (or polars), and log the table with rr.send_dataframe:
df = pd.read_csv(csv_path) # e.g. columns: frame, x, y
rr.send_dataframe(pa.Table.from_pandas(df), index="frame", entity_path="/data")To show the values as points, boxes, or other archetypes, log them with send_columns instead.
HDF5
There is no built-in HDF5 importer.
In Python, the experimental rerun.experimental.Hdf5Reader maps each HDF5 group to an entity and its datasets to components:
reader = rr.experimental.Hdf5Reader(hdf5_path)
# Rows are indexed on a generated `row_index` timeline.
rr.send_chunks(reader.stream())All non-scalar datasets must have the same number of rows.
Pass index_column= to stream() to use one of the datasets as the timeline (e.g. IndexColumn.sequence("/frame_id") from rerun.chunk), and ignore_datasets= to skip datasets that don't fit.
Use reader.groups(), reader.datasets(), and reader.attributes() to inspect the file first.
You can also read the file with h5py and log the arrays yourself.
Parquet
.parquet files have a built-in importer (see the list above).
For more control in Python, the experimental rerun.experimental.ParquetReader reads a file into a LazyChunkStream that you can reshape with lenses before sending it with rr.send_chunks.
Importers
Importers load files into the Viewer and the SDK. This section explains how Rerun picks an importer for a file, and the two ways to add your own for file types Rerun does not support.
Internally, the Importer trait takes care of loading files into the Viewer and/or SDK.
There are 3 broad kinds of Importers: builtin, external and custom.
External and custom are the two ways of extending the file loading system that we'll describe below.
When a user attempts to open a file in the Viewer/SDK, all known Importers are notified of the path to be opened, unconditionally.
This gives Importers maximum flexibility to decide what files they are interested in, as opposed to e.g. only being able to look at a file's extension.
Once notified, an Importer can return an ImporterError::Incompatible error to indicate that it doesn't support a given file type.
If, and only if, all importers known to the Viewer/SDK return an Incompatible error code, then an error message is shown to the user indicating that this file type is not (yet) supported.
In these instances of unsupported files, we expose two ways of implementing and registering your Importers, explained below.
External importers
The easiest way to create your own Importer is by implementing what we call an "external importer": a stand alone executable written in any language that the Rerun SDK ships for. Any executable on your $PATH with a name that starts with rerun-importer- will be treated as an Importer.
This executable takes a file path as a command line argument and outputs Rerun logs on stdout.
It will be called by the Rerun Viewer/SDK when the user opens a file, and be passed the path to that file.
From there, it can log data as usual, using the stdout logging sink.
The Rerun Viewer/SDK will then automatically load the data streamed to the external importer's standard output.
Like any other Importer, an external importer will be notified of all file openings, unconditionally.
To indicate that it does not support a given file, the importer has to exit with a dedicated status code.
When the Viewer and/or SDK executes an external importer, it will pass to it a set of recommended settings in the form of CLI parameters (in addition to the file path to be loaded, which is passed as the one and only positional argument):
--application-id <application_id>The recommended
ApplicationIdto log the data to.--opened-application-id <opened_application_id>(optional)The
ApplicationIdthat is currently opened in the viewer, if any.--recording-id <store_id>The recommended
RecordingIdto log the data to.Log data to this recording if you want it to appear in a new recording shared by all importers for the current loading session.
--opened-recording-id <opened_store_id>(optional)The
RecordingIdthat is currently opened in the viewer, if any.--entity-path-prefix <entity_path_prefix>(optional)Recommended prefix to prepend to all entity paths.
--static(optional)The data is expected to be logged as static.
--time_sequence <timeline1>=<seq1> <timeline2>=<seq2> …(optional)The data is expected to be logged at these specific sequence times.
--time_duration_nanos <timeline1>=<duration1> <timeline2>=<duration2> …(optional)The data is expected to be logged at these specific duration times.
The timestamps are expected to be in nanoseconds: use
rr.set_time(timeline, duration=np.timedelta64(nanos, "ns"))(Python) /RecordingStream::set_time_duration_nanos(C++) /RecordingStream::set_time(timeline, std::time::Duration::from_nanos(nanos))(Rust) appropriately.--time_timestamp_nanos <timeline1>=<timestamp1> <timeline2>=<timestamp2> …(optional)The data is expected to be logged at these specific timestamp times.
The timestamps are expected to be in nanoseconds since Unix epoch: use
rr.set_time(timeline, timestamp=np.datetime64(nanos, "ns"))(Python) /RecordingStream::set_time_timestamp_nanos_since_epoch(C++) /RecordingStream::set_timestamp_nanos_since_epoch(Rust) appropriately.
Check out our examples for C++, Python and Rust that cover every step in detail.
Custom Rust importers
Another Rust-specific approach is to implement the Importer trait yourself and register it in the Rerun Viewer/SDK.
To do so, you'll need to import rerun as a library, register your Importer and then start the Viewer/SDK from code.
Check out our example that covers all these steps in detail.