Repository navigation
refactor(mcap): encode and rewrite video messages through hebbian-mcap 0.1.1 - #785
Merged
Merged
Conversation
…p 0.1.1 The video importer, LeRobot importer and transform build CompressedVideo messages and the schema record with the shared Rust encoder. Transform and doctor read pass-through video through CompressedVideoCodec, which walks ROS 2 CDR by the channel's schema and replaces protobuf payloads at the wire level, so the Python re-encoding workaround is removed. Bump TRANSFORM_BEHAVIOR_VERSION to 13: the schema record and library identifier change, and repaired protobuf messages keep their field order. foxglove-schemas-protobuf moves to the dev group because only tests import it.
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were established.
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
HFlow no longer carries its own code for building and re-serializing
CompressedVideomessages. That logic now lives in the shared Rust core ofhebbian-mcap0.1.1, used through its Python bindings.encode_compressed_videoandCOMPRESSED_VIDEO_SCHEMA.CompressedVideoCodec. ROS 2 CDR messages are walked by the channel's own schema, so fields a recorder added are still preserved when an access unit delimiter is inserted. Protobuf payloads are replaced at the wire level, so unknown fields survive._resolve_encoder,_Ros2VideoMessageWithDataand doctor's decoder-factory loop.Decoding of arbitrary topics (
episode.py) and of compressed images in the transform still usesmcap_protobufandmcap_ros2.Behavior bump
TRANSFORM_BEHAVIOR_VERSIONmoves from 12 to 13. The transform writes different bytes for the same input:foxglove.CompressedVideoschema record now carries protobufjson_nameentries. Readers treat it the same.hebbian-mcap/0.1.1.Decoded message content is unchanged. Regenerate derived outputs from the source recordings.
Dependencies
hebbian-mcappin moves from 0.1.0 to 0.1.1.foxglove-schemas-protobufmoves from runtime dependencies to the dev group, because only tests import it. Code that relied on HFlow installing it needs to depend on it directly.Tests
test_transform_preserves_decoder_owned_video_messagesmonkeypatched the removed decoder path. It is nowtest_transform_preserves_every_field_of_passthrough_video_messagesand asserts on the written file: the recorder's extraoriginalfield survives for CDR, and the payload, format and frame are intact for both encodings.Validation
uv run ruff check --fix uv run ruff format uv run ty check uv run pytest -q -n auto # 2647 passed, 8 skipped🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.