Skip to content
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

Merged
merged 12 commits into from
Sep 11, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Sep 10, 2024

What


  • 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!

image

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@Wumpf Wumpf added exclude from changelog PRs with this won't show up in CHANGELOG.md 🎞️ video labels Sep 10, 2024
Copy link

github-actions bot commented Sep 10, 2024

Deployed docs

Commit Link
5cfd549 https://landing-phsglo6gv-rerun.vercel.app/docs

/// Follow <https://github.com/rerun-io/rerun/issues/7298> for updates on the native support.
///
/// In order to display a video, you need to log a [archetypes.VideoFrameReference] for each frame.
// TODO(andreas): More docs and examples on how to use this.
Copy link
Member

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

.vscode/settings.json Outdated Show resolved Hide resolved
.vscode/settings.json Outdated Show resolved Hide resolved
@Wumpf Wumpf marked this pull request as draft September 10, 2024 15:17
@Wumpf
Copy link
Member Author

Wumpf commented Sep 10, 2024

(drafted until I remove accidentially pushed stuff)
fixed

rerun_py/Cargo.toml Outdated Show resolved Hide resolved
pixi.toml Outdated Show resolved Hide resolved
@Wumpf Wumpf force-pushed the andreas/video-frame-references branch from a7f0a2b to 5df57f3 Compare September 10, 2024 15:18
@Wumpf Wumpf marked this pull request as ready for review September 10, 2024 15:20
Comment on lines +14 to +15
/// Timestamp inside a [archetypes.AssetVideo].
struct VideoTimestamp (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still love to eventually have time_mode = FrameNumber.

So calling this a Timestamp will create a bit of a strange naming pattern.

Copy link
Member Author

Choose a reason for hiding this comment

The 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.
very open to other suggestions not sure on this one 🤷

https://rerunio.slack.com/archives/C041NHU952S/p1725981749912279?thread_ts=1725981199.569259&cid=C041NHU952S

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some ideas from ChatGPT

VideoPosition: Emphasizes that the struct represents a position in the video, which could be either in frames or seconds.
VideoMarker: Suggests a point in the video, adaptable to frames or time.
TimeOrFrame: Makes it clear that the struct can hold either a time value or a frame number.
FrameOrTimeStamp: Explicitly names the two modes.
VideoCoordinate: Represents a general position in time (seconds or frames) as coordinates often imply different dimensions.
MediaTimeUnit: Indicates the struct holds a unit of time in different formats, either frames or seconds.
PlaybackPosition: Focuses on the position in playback, where both time and frame counts are relevant.
TimelineIndex: Suggests an index along a timeline that can be expressed in either frames or time.

@Wumpf Wumpf requested a review from jprochazk September 10, 2024 18:52
Copy link
Member

@jprochazk jprochazk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great!

Naming is a non-issue imo, we can change it in a follow-up PR if we think VideoTimestamp really doesn't work

@Wumpf Wumpf merged commit e77459b into main Sep 11, 2024
39 of 40 checks passed
@Wumpf Wumpf deleted the andreas/video-frame-references branch September 11, 2024 09:57
jprochazk pushed a commit that referenced this pull request Sep 11, 2024
…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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md 🎞️ video
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants