Can windowjs run headless? #30
-
I've been playing with With the current API, I'm capable of generating screenshots on every animation frame that I can then process with Thank you, and keep up the excellent work! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Hi, and thanks for the feedback! IIUC, you'd like to capture screenshots very often, maybe on every frame, and export them automatically; and ideally, skip showing the main window while doing that. Is the understanding correct? I guess you've already tried setting Here's 3 different ways to capture a screenshot:
Could you give these details to help diagnose the problem:
|
Beta Was this translation helpful? Give feedback.
-
Many thanks for the excellent response. I was using the As you said, running just Using I believe that a more robust implementation, with fixed framerate and other guards to handle the creation of the images might fix most problems. Maybe even find a way to control the JavaScript time engine to control when each frame gets rendered before moving to the next. I wouldn't mind sacrificing time in exchange for a complete render of all the frames necessary to create a perfect animation during the Here are the answers to your questions:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the help Guzman. I could reproduce the original issues at v0.1.8, and also verified that they're now fixed at HEAD:
I'll prepare a new signed release with the fixes (v0.1.9). If you give this another try then please post back any findings. Many thanks! |
Beta Was this translation helpful? Give feedback.
Hi, and thanks for the feedback!
IIUC, you'd like to capture screenshots very often, maybe on every frame, and export them automatically; and ideally, skip showing the main window while doing that. Is the understanding correct?
I guess you've already tried setting
window.visible = false
; the screenshot capturing doesn't work when you do that? If that's the case then it's a bug to be fixed. I'm surprised that it doesn't work, but will have to investigate why.Here's 3 different ways to capture a screenshot:
canvas.encode(). This is probably the best solution, and should work even when the window is invisible (there might be a bug in there though)
canvas.getImageData() + imageData.encode()