nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.42k stars 3.88k forks source link

capturePage not working with "webm" #689

Open aemkei opened 11 years ago

aemkei commented 11 years ago

When I try to generate a still frame using .capturePage(callback, 'webm') it falls back to the jpeg .

See: window_bindings.js#L323

I really love this project and would like to use it to create video using Whammy.

Thanks for you help!

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

zhchbin commented 11 years ago

Hi @aemkei , thanks for your support for this project. Window.capturePage(callback [, image_format]) only support ["jpeg", "png"]. as you can see.

However, the following workaround may work for you: load the dataUrl with Image object and use context.drawImage, then this context can be added by using encoder.add(context or canvas or dataURL);

I also modified the clock demo of the Whammy to test whether this work. Here is the zip file for your reference.

aemkei commented 11 years ago

Hey @zhchbin: Thanks for the info! We are already using this context.drawImage workaround. But it slows down the video generation.

I'm not sure how much work it is to add webm to the list of supported formats in node-webkit. Just wanted to ping the developers and hope to see it in one of the next versions.

zhchbin commented 11 years ago

@aemkei This API is implemented by me. I borrowed most of them from chromium code. It seems that add webm wouldn't be an easy work. So hope someone others can make progress in it.

EthraZa commented 7 years ago

Is this still the case? I'm trying with Ccapture.js, that uses Whammy, and it is generating an unplayable webm video.