-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce
VideoFrameReference
archetype and base video visualizatio…
…n on it (#7396) ### What * Large chunk of #7368 --- * Introduce `VideoFrameReference` archetype * comes with a bunch of subtypes * Make the video visualizer use this * in the process I did some general iteration on how this visualizer ticks * note that I departed from the usual quite encrusted patterns of how to implement visualizers that naturally found its way into here as well. Imho the patterns don't hold up all that well in general (we had to grind over them many times in quick succession) and less so in particular for "special" archetypes like video or mesh (etc.) * video data loader emits `VideoFrameReference` instead of the adhoc `VideoTick Still missing for completion of the video frame reference task: * examples to use this from SDKs (by directly logging video frames) * this surely will show that we need more extensions * pretty/edit ui for video timestamps * @Wumpf are you saying that you can then scrub videos from a blueprint slider?! Yes. That's exactly what will end up happening ;D * pretty/edit ui for entity paths * exposed utilities to SDKs for generation of video frame references @ reviewers: Special attention please on the fbs definition, thank you! <img width="1813" alt="image" src="https://github.com/user-attachments/assets/d221ff1e-7ec0-4067-8916-7a8dd2ed8002"> ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7396?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7396?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! * [x] If have noted any breaking changes to the log API in `CHANGELOG.md` and the migration guide - [PR Build Summary](https://build.rerun.io/pr/7396) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
- Loading branch information
Showing
75 changed files
with
2,310 additions
and
276 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 5 additions & 2 deletions
7
...es/definitions/rerun/archetypes/video.fbs → ...initions/rerun/archetypes/asset_video.fbs
This file contains 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
26 changes: 26 additions & 0 deletions
26
crates/store/re_types/definitions/rerun/archetypes/video_frame_reference.fbs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace rerun.archetypes; | ||
|
||
/// References a single video frame. | ||
/// | ||
/// Used to display video frames from a [archetypes.AssetVideo]. | ||
// TODO(#7368): More docs and examples on how to use this. | ||
table VideoFrameReference ( | ||
"attr.rerun.experimental" | ||
){ | ||
// --- Required --- | ||
|
||
/// References the closest video frame to this timestamp. | ||
/// | ||
/// Note that this uses the closest video frame instead of the latest at this timestamp | ||
/// in order to be more forgiving of rounding errors for inprecise timestamp types. | ||
timestamp: rerun.components.VideoTimestamp ("attr.rerun.component_required", required, order: 1000); | ||
|
||
// --- Optional --- | ||
|
||
/// Optional reference to an entity with a [archetypes.AssetVideo]. | ||
/// | ||
/// If none is specified, the video is assumed to be at the same entity. | ||
/// Note that blueprint overrides on the referenced video will be ignored regardless, | ||
/// as this is always interpreted as a reference to the data store. | ||
video_reference: rerun.components.EntityPath ("attr.rerun.component_optional", nullable, order: 2000); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
crates/store/re_types/definitions/rerun/components/entity_path.fbs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace rerun.components; | ||
|
||
/// A path to an entity, usually to reference some data that is part of the target entity. | ||
table EntityPath ( | ||
"attr.arrow.transparent", | ||
"attr.python.aliases": "str", | ||
"attr.python.array_aliases": "str, Sequence[str]", | ||
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord", | ||
"attr.rust.repr": "transparent" | ||
) { | ||
value: rerun.datatypes.EntityPath (order: 100); | ||
} |
11 changes: 11 additions & 0 deletions
11
crates/store/re_types/definitions/rerun/components/video_timestamp.fbs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
namespace rerun.components; | ||
|
||
/// Timestamp inside a [archetypes.AssetVideo]. | ||
struct VideoTimestamp ( | ||
"attr.rust.derive": "Copy, PartialEq, Eq, Default", | ||
"attr.rust.repr": "transparent", | ||
"attr.rerun.experimental" | ||
) { | ||
timestamp: rerun.datatypes.VideoTimestamp (order: 100); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
crates/store/re_types/definitions/rerun/datatypes/video_timestamp.fbs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace rerun.datatypes; | ||
|
||
/// Specifies how to interpret the `video_time` field of a [datatypes.VideoTimestamp]. | ||
enum VideoTimeMode: ubyte{ | ||
/// Invalid value. Won't show up in generated types. | ||
Invalid = 0, | ||
|
||
/// Presentation timestamp in nanoseconds since the beginning of the video. | ||
Nanoseconds = 1 (default), | ||
|
||
// Future values: FrameNr | ||
} | ||
|
||
/// Timestamp inside a [archetypes.AssetVideo]. | ||
struct VideoTimestamp ( | ||
"attr.rust.derive": "Copy, PartialEq, Eq", | ||
"attr.rerun.experimental" | ||
) { | ||
/// Timestamp value, type defined by `time_mode`. | ||
video_time: long (order: 100); | ||
|
||
/// How to interpret `video_time`. | ||
time_mode: VideoTimeMode (order: 200); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.