Closed LmanTW closed 6 months ago
You can get raw pixel data on context2d (it's rgba order, unlike bgra in node-canvas) and then do whatever you want with it like stream into ffmpeg:
const imageData = ctx.getImageData(0, 0, 1080, 1920).data
const buffer = Buffer.from(imageData)
writeFileSync(`out/${frameNum}.raw`, buffer);
It works, thanks for helping!
I am using Automattic/node-canvas, I want to change to this canvas, but I tried it and it seems that I can't convert canvas to raw, is there a way to convert canvas to raw?