Skip to main content

MCAP Tools: Rust and Python writing and video export

CI PyPI

Write standard MCAP recordings with separate chunk groups for video and telemetry, encode and decode ROS 2/Foxglove messages, and export camera topics from MCAP to MP4. Python and Rust share the official Rust MCAP writer through a small grouping layer. Maintained by Hebbian Robotics; this is an independent Foxglove-compatible project, not an official Foxglove product.

Install

uv add 'hebbian-mcap==0.1.2'

Prebuilt CPython 3.11+ wheels support Linux (glibc 2.17+, x86_64/aarch64), macOS (x86_64/aarch64) and Windows (x86_64), without a Rust installation. Source builds require Rust 1.92+. The Rust crate is available through a pinned Git dependency and is not published to crates.io; see the Rust crate guide.

Write grouped MCAP recordings

from hebbian_mcap import GroupedMcapWriter, NO_SCHEMA_ID

with GroupedMcapWriter("recording.mcap") as writer:
    channel = writer.register_channel("/state", "json", NO_SCHEMA_ID, group="telemetry")
    writer.write_message(channel, 123, b'{"position": 1}')

Groups buffer independently, so indexed readers can select camera data without fetching telemetry chunks, or vice versa. Standard MCAP compression, indexes, metadata and attachments are preserved. Python path outputs are published atomically; caller-owned streams stay open.

See the writer behavior reference for timestamps, flush rules and lifecycle. For reading, use the official Python MCAP reader.

Read and rewrite video messages

Read a channel's CompressedVideo messages, or replace a payload and keep every other field:

from hebbian_mcap import CompressedVideoCodec

codec = CompressedVideoCodec(channel.message_encoding, schema.encoding, schema.name, schema.data)
video = codec.decode(message.data)
repaired = codec.replace_data(message.data, new_payload)

Foxglove protobuf and ROS 2 CDR channels are supported. CDR messages are read through the channel's schema, so fields a recorder added are preserved. See standard messages.

Export MCAP camera video to MP4

Install the video extra, then select a camera topic:

uv add 'hebbian-mcap[video]==0.1.2'
mcap-export recording.mcap front.mp4 --topic /cameras/front/video

The equivalent Python API is:

from pathlib import Path
from hebbian_mcap.video import export_mcap_camera

result = export_mcap_camera(
    Path("recording.mcap"), Path("front.mp4"), camera_topic="/cameras/front/video"
)

Export requires at least two frames and fixed dimensions. It preserves log-time gaps, leaves the source unchanged and refuses to overwrite an existing output. See video export behavior for supported formats, timing and limits.

Only the video extra installs PyAV, NumPy and message decoders. The base Python writer and Rust crate do not need video codecs. hebbian_mcap.h264 provides standard-library-only Annex B inspection and repair helpers.

References and development

Rust/Python code uses Apache-2.0, with MIT exceptions described in NOTICE. Browser utilities use MIT.

Browser playback

The TypeScript library provides HTTP byte-range reading for MCAP, H.264 remuxing to MP4 and a shared playback clock for multiple cameras. It is independent of the Rust/Python writer and any robot application.

Metadata

Release files for hebbian-mcap 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hebbian-mcap 0.1.2
File Size Uploaded Provenance Actions
hebbian_mcap-0.1.2.tar.gz 45.3 kB Without provenance Details for hebbian_mcap-0.1.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for hebbian-mcap 0.1.2
File Actions
hebbian_mcap-0.1.2-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for hebbian_mcap-0.1.2-cp311-abi3-win_amd64.whl
hebbian_mcap-0.1.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for hebbian_mcap-0.1.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
hebbian_mcap-0.1.2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for hebbian_mcap-0.1.2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
hebbian_mcap-0.1.2-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for hebbian_mcap-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
hebbian_mcap-0.1.2-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for hebbian_mcap-0.1.2-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 3.2 MB

Release files / hebbian_mcap-0.1.2.tar.gz

Download URL hebbian_mcap-0.1.2.tar.gz
Size 45.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9fc55a9b450cf7c40efb657e194350c08317f2511491f578ffa36834cc8dcd42
BLAKE2b-256 checksum
How to use checksums
b8e5d61bfc133be570c2f91869b20650148edc87c3debd0f4fd3acfcf9c2c050
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hebbian_mcap-0.1.2-cp311-abi3-win_amd64.whl

Download URL hebbian_mcap-0.1.2-cp311-abi3-win_amd64.whl
Size 508.0 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
91fb86c1992e4c399731657d20d86659ef52793b0f4bcf70fe705aebbbce0864
BLAKE2b-256 checksum
How to use checksums
2a6d3c1484a700eb50ee344999c1dbbbf6c0cd080c2ce201e5d402363707fef2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hebbian_mcap-0.1.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL hebbian_mcap-0.1.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 708.8 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
7cecd93764aa28e10d8dcd321223827bdeafec93415c3e3ef09d1d1d59296c31
BLAKE2b-256 checksum
How to use checksums
32d756e4b2e17852d7ad54cc9503848e43fafe2c2cc03f17e3f4ac78f2d277e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hebbian_mcap-0.1.2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL hebbian_mcap-0.1.2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 709.8 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
eab5c0036c720050749293ff480176f4e40c5af9241534f6e2caa295656095c7
BLAKE2b-256 checksum
How to use checksums
ab6dcda444ecd4a3e8c69b95e2262722640d3a4c4fe4529d18125da4e19f72f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hebbian_mcap-0.1.2-cp311-abi3-macosx_11_0_arm64.whl

Download URL hebbian_mcap-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
Size 579.0 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ecdb539053bb6b87680f9ec8557066a42329d8b2d0ecfc4e0f89413382466e24
BLAKE2b-256 checksum
How to use checksums
3b8e1b0d85d8052b9f2c1d8d7182856e7c172645afda29b123860a15d9ac5178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hebbian_mcap-0.1.2-cp311-abi3-macosx_10_12_x86_64.whl

Download URL hebbian_mcap-0.1.2-cp311-abi3-macosx_10_12_x86_64.whl
Size 634.9 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3bb88c08b456295235b8d217a3870abaf93e4757ce52e3771bf93b2a93307159
BLAKE2b-256 checksum
How to use checksums
16575b8bfaef8e1c903549b5c193985c6edbc6fca89a5bdc0f8434f04f096736
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for hebbian-mcap 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page