-
Notifications
You must be signed in to change notification settings - Fork 34
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
Conversation
…by adding a new function record_video
…the 3D cell morphology
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.
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( |
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.
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?
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.
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 |
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.
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) |
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.
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?
Repalced this with #342 to remove branch conflicts |
I have modified the code in the create_new_vispy_canvas function to add video recording functionality