antimatter15 / whammy

A real time javascript webm encoder based on a canvas hack
http://antimatter15.github.com/whammy/clock.html
MIT License
1.02k stars 182 forks source link

Deferred webp encoding for faster frame add #35

Closed positlabs closed 8 years ago

positlabs commented 8 years ago

Storing image data is much faster than encoding to webp. This PR stores the image data, and waits to encode webp in the compile method.

Here are some test videos from #34

Immediate encoding: https://youtu.be/QK9AOAvGMsw

Delayed encoding: https://youtu.be/99Kob5Xv0Yk

positlabs commented 8 years ago

Don't merge this PR yet. I am going to try modifying it so it doesn't totally block the main thread during compilation.

positlabs commented 8 years ago

This works great, but note that there is a breaking change included. The signature of WhammyVideo.compile has changed to compile(outputAsArray, callback) because it's now an async method.