@perry-rylance/node-canvas-video-recorder
v1.0.1
Published
Capture video from a HTML canvas
Downloads
4
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.jsonadd"capture": "npx ts-node-esm ./node_modules/@perry-rylance/node-canvas-video-recorder/src/server.ts". - In your projects
package.jsonadd acaptureobject, this needs to specifyurl,output,widthandheight.
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
canvaselement. - The page must add a method
renderto thewindow, which receivesplayhead(0.0 - 1.0). - Your
renderfunction should manipulate the canvas. - Run
npm run captureto generateoutput.mp4
