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

when camera_type is equirectangular, add spherical metadata to rendered video #1151

Conversation

machenmusik
Copy link
Contributor

Implements #1149.

@machenmusik machenmusik force-pushed the equirect-render-spherical-metadata branch from eed5d40 to 8848729 Compare December 20, 2022 07:23
@machenmusik machenmusik force-pushed the equirect-render-spherical-metadata branch from 8848729 to c4dade4 Compare December 20, 2022 07:28
@machenmusik machenmusik force-pushed the equirect-render-spherical-metadata branch from 4715e03 to 38325b8 Compare December 20, 2022 07:58
Copy link
Contributor

@tancik tancik left a comment

Choose a reason for hiding this comment

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

Thanks for digging into the details for this functionality. It's a great addition!

scripts/render.py Outdated Show resolved Hide resolved
Note: video render width and height were unspecified for spiral trajectory; this uses values for Nerfacto
@machenmusik
Copy link
Contributor Author

machenmusik commented Dec 21, 2022

It seemed inefficient for all rendered images to be held in memory just to encode video, so that is no longer done.

As a curious side effect, I noticed that non-filename trajectories such as spiral don't have a defined render width or height. That didn't matter before when passing all the images at once to be encoded,, but it does now that we create the video writer before we have the first image (and its size). The values for Nerfacto are currently the default for spiral trajectory, but if there is a better way to know what resolution should be expected, that would be preferable.

For later perhaps: it should be possible to reuse camera path files, but override the width and height for a given render command. (That might also help eliminate the ambiguity for non-filename trajectories.)

@machenmusik machenmusik force-pushed the equirect-render-spherical-metadata branch 2 times, most recently from 1eb9723 to c6487f9 Compare December 21, 2022 03:29
@machenmusik machenmusik force-pushed the equirect-render-spherical-metadata branch from c6487f9 to 963758c Compare December 21, 2022 03:44
@machenmusik
Copy link
Contributor Author

(okay, finally got isort / black / pylint to agree...)

Copy link
Contributor

@tancik tancik left a comment

Choose a reason for hiding this comment

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

LGTM, this restructure looks good to me. Thanks for working on this.

scripts/render.py Outdated Show resolved Hide resolved
@tancik
Copy link
Contributor

tancik commented Dec 21, 2022

Looks good, feel free to merge. You should now have access (check your email)

@machenmusik machenmusik merged commit 0e1ea37 into nerfstudio-project:main Dec 21, 2022
@machenmusik machenmusik deleted the equirect-render-spherical-metadata branch December 21, 2022 05:32
@machenmusik
Copy link
Contributor Author

Done thx

tancik pushed a commit to dozeri83/nerfstudio that referenced this pull request Jan 20, 2023
…ed video (nerfstudio-project#1151)

* when camera_type is equirectangular, add spherical metadata to rendered video

* remove unnecessary CONSOLE.print

* refactor to make pylint happier

* get os.stat size properly; document camera_type argument

* write video on the fly to avoid holding all images in memory

Note: video render width and height were unspecified for spiral trajectory; this uses values for Nerfacto

* fix images output

* doc fix
chris838 pushed a commit to chris838/nerfstudio that referenced this pull request Apr 22, 2023
…ed video (nerfstudio-project#1151)

* when camera_type is equirectangular, add spherical metadata to rendered video

* remove unnecessary CONSOLE.print

* refactor to make pylint happier

* get os.stat size properly; document camera_type argument

* write video on the fly to avoid holding all images in memory

Note: video render width and height were unspecified for spiral trajectory; this uses values for Nerfacto

* fix images output

* doc fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants