-
Notifications
You must be signed in to change notification settings - Fork 451
Refactor MaxImageDimensionSubscriber
#7850
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
Conversation
Actually, I just realized this means each video is parsed twice, which is… not great. I'll look into giving |
MaxImageDimensionSubscriber
if true { | ||
None // TODO(#7821): Use the VideoCache here so we make sure we only load each video ONCE | ||
} else { | ||
re_video::VideoData::load_from_bytes(&blob, &media_type) | ||
.ok() | ||
.map(|video| video.dimensions()) | ||
} |
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.
This is the core of it. I'll work on having access to VideoCache
here, and then we can resolve this in a follow-up PR.
…or we add functionality to re_mp4
to very quickly parse an .mp4 to only look for its size info 🤔
That would be easy if we had:
(…and used memory-mapping)
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.
👍 looks like a good step forward
max_dim.width = max_dim.width.max(width); | ||
} | ||
} | ||
if let Some([width, height]) = size_from_blob(blob.as_ref(), media_type.as_deref()) |
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.
nit:
if let Some([width, height]) = size_from_blob(blob.as_ref(), media_type.as_deref()) | |
let Some([width, height]) = size_from_blob(blob.as_ref(), media_type.as_deref()) else { | |
continue; | |
}; |
What
The change is that
MaxImageDimensionSubscriber
parses each.mp4
to figure out its size……except I disabled that check last-second because we don't have access to the
VideoCache
, and so this PR would lead to each video getting parsed twice.Still, I would like to get this PR merged as a necessary refactor and generally improved structure.
This is where we're heading:

Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerCHANGELOG.md
and the migration guideTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.