@perry-rylance/node-canvas-video-recorder
v1.0.1
Published
Capture video from a HTML canvas
Downloads
3
Readme
Node Canvas Video Recorder
Drop in package for recording video from a canvas element.
Installation
npm install @perry-rylance/node-canvas-video-recorder
.- In your projects
package.json
add"capture": "npx ts-node-esm ./node_modules/@perry-rylance/node-canvas-video-recorder/src/server.ts"
. - In your projects
package.json
add acapture
object, this needs to specifyurl
,output
,width
andheight
.
Usage
- You need a server serving up a page with your canvas on at the URL you previously specified in
package.json
'scapture
. - The page must have a
canvas
element. - The page must add a method
render
to thewindow
, which receivesplayhead
(0.0 - 1.0). - Your
render
function should manipulate the canvas. - Run
npm run capture
to generateoutput.mp4