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

Issue/318- Adding Video recording functionality to vispy viewer #334

Closed

Conversation

AdityaBITMESRA
Copy link
Contributor

@AdityaBITMESRA AdityaBITMESRA commented Apr 13, 2024

I have modified the code in the create_new_vispy_canvas function to add video recording functionality

@sanjayankur31 sanjayankur31 self-requested a review April 16, 2024 16:06
Copy link
Member

@sanjayankur31 sanjayankur31 left a comment

Choose a reason for hiding this comment

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

Looking good, but needs a few changes. My main question is---can the canvas etc. we already create not be used? Why is a new one required?

Also: in the future, I wouldn't use the development branch for PRs. It's best to create a new branch from development and use that. That way your development branch always remains clean and matches our upstream development branch.

view = scene_canvas.central_widget.add_view()

camera = scene_canvas.central_widget.camera
view.camera = camera

canvas = scene.SceneCanvas(
Copy link
Member

Choose a reason for hiding this comment

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

we're already creating a SceneCanvas, camera, view etc. here---do you need to create one too? Can the ones we already create not be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes sir you are correct I think I ignored this.

if event.key == "r":
# Start recording video
output_file = "output.mp4"
duration = 10 # Video duration in seconds
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to not limit the video duration? We can have an upper limit, but ideally what we want is:

  • press r to start recording
  • press r after some time to stop recording

That'll allow users to make multiple recordings, and the file name can increment: output-1.mp4, output-2.mp4 and so on?

@@ -120,6 +125,14 @@ def create_new_vispy_canvas(
"""
# vispy: full gl+ context is required for instanced rendering
use(gl="gl+")
canvas_name = "My 3D Visualization"
canvas, scene_canvas, view = create_new_vispy_canvas(canvas_name)
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this calling itself recursively: create_new_vispy_canvas is calling itself, and there's no break clause to break the recursion? Have you tested this code out to see that it works?

@sanjayankur31 sanjayankur31 added T: enhancement Type: enhancement S: waiting on reporter Waiting on reporter labels Apr 16, 2024
@AdityaBITMESRA
Copy link
Contributor Author

Repalced this with #342 to remove branch conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: waiting on reporter Waiting on reporter T: enhancement Type: enhancement
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[vispy viewer] investigate if we can record a video of the rotating image
2 participants