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

using CCapture to render a javascript starfield animation as a webm file #128

Open
xenophoria opened this issue Apr 24, 2021 · 2 comments
Open

Comments

@xenophoria
Copy link

I am trying to learn how to use CCapture to render a javascript starfield animation as a webm file. I can download png snapshots of a single canvas but am having no success downloading them as frames of a webm file.

The animation lasts 5 minutes in total and has 10 states each lasting 30 seconds. As a test I tried to capture after 35 seconds but nothing downloads after 35 seconds. When I click on the screen a png file is downloaded.

var capturer = new CCapture( { format: 'webm', framerate: 30, name: 'starfield.webm', verbose: true, timeLimit: 35, autoSaveTime: 0.5 } );

I’m not sure if I have specified the capturer properties correctly. Can anyone point out what I am doing wrong. Thanks

https://jsfiddle.net/1syh7m59/

@spite
Copy link
Owner

spite commented Apr 24, 2021

i took a look at your code. where are you calling capturer.capture(canvas) ?
you need to pass the canvas every time you step your animation

@GregSchiemer
Copy link

Great. I thought that might be the right question. I'll continue looking for the answer. When I find it, I'll share a working example for your documentation. This will be such a great tool for capturing animations!

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

No branches or pull requests

3 participants