Skip to content

feat(pj_base): AssetVideo clip-window (start_ns/end_ns)#97

Merged
facontidavide merged 1 commit into
mainfrom
feat/asset-video-clip-window
May 27, 2026
Merged

feat(pj_base): AssetVideo clip-window (start_ns/end_ns)#97
facontidavide merged 1 commit into
mainfrom
feat/asset-video-clip-window

Conversation

@Alvvalencia
Copy link
Copy Markdown
Contributor

Summary

Replaces AssetVideo::duration_ns with a [start_ns, end_ns) clip-window so a
single MP4 asset can be addressed as a fragment instead of "the whole file from
frame 0".

Motivation

LeRobot v3.0 datasets pack multiple episodes into the same .mp4: episode e
occupies a [start, end) time range within the shared video, identified via
meta/episodes/chunk-NNN/file-MMM.parquet shard metadata. The previous
duration_ns field assumes 1 entity = 1 full file and can't express this.

start_ns/end_ns is also strictly more general — for the single-episode case
set start_ns=0, end_ns=duration_ns and behavior is identical.

Downstream

This unblocks two consumer PRs:

  • PJ4 — feat/asset-video-clip-consumer: FileVideoSource honors the
    clip-window through pj_scene2D.
  • pj-official-plugins — feat/lerobot-v3-support: the LeRobot v3.0 reader
    emits clip-windows from episode_shards.

Test plan

  • pj_base builds + existing tests pass
  • Downstream PJ4 branch builds against this SHA
  • (Manual, via downstream PRs) LeRobot v3.0 episode plays only its shard

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

All contributors have signed the CLA. Thank you!
Posted by the CLA Assistant Lite bot.

@Alvvalencia
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

…ip window

The previous `duration_ns` field carried the total playable duration of a
video asset but had no readers: pj_scene2D's FileVideoSource asks ffmpeg
directly on open, and no other consumer in plotjuggler_core or pj_scene2D
read the value. Removing it makes room for an in-file playback window
`[start_ns, end_ns]` expressed as ns offsets from the first frame.

The new semantics unlock LeRobot v3.0 datasets, where a single per-camera
MP4 file packs many concatenated episodes back-to-back. The episodes
parquet exposes per-episode `[from_timestamp, to_timestamp]` in float
seconds, which map directly to `[start_ns, end_ns]` after a *1e9 cast.
v2.1 datasets and any other producer that wants whole-file playback
leave both fields absent — unchanged behavior.

New fields are 8 and 9 (optional int64, varint).
@Alvvalencia Alvvalencia force-pushed the feat/asset-video-clip-window branch from 75bee20 to ec6e2c0 Compare May 27, 2026 08:38
@facontidavide facontidavide merged commit 430eb70 into main May 27, 2026
2 of 3 checks passed
@facontidavide facontidavide deleted the feat/asset-video-clip-window branch May 27, 2026 09:17
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants