-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce VideoFrameReference
archetype and base video visualization on it
#7396
Changes from 10 commits
e59c1c6
c9bdfbd
219d203
4bcfc11
a5cd6c9
904303c
b040f4c
5df57f3
c0efad5
e7e1ab9
e1f408e
5cfd549
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace rerun.archetypes; | ||
|
||
/// References a single video frame. | ||
/// | ||
/// Used to display video frames from a [archetypes.AssetVideo]. | ||
// TODO(andreas): More docs and examples on how to use this. | ||
table VideoFrameReference ( | ||
"attr.rerun.experimental" | ||
){ | ||
// --- Required --- | ||
|
||
/// References the closest video frame to this time. | ||
/// | ||
/// Note that this uses the closest video frame instead of the latest at this timestamp | ||
/// in order to be more forgiving of rounding errors. | ||
// TODO(andreas): Once this can also be a frame index, point out that this is an accurate measure. | ||
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.
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); | ||
} |
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.
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 ( | ||
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would still love to eventually have So calling this a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. coincidentally I brought this very thing up on Slack expressing a similar (but not very deep) concern. @emilk pointed out that frame numbers can be seen as a form timestamp unit in this context. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some ideas from ChatGPT
|
||
"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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's point these TODOs to the correct issue