HTML Canvas API can be used to efficiently render graphics in a HTML page.

Media Recorder

There are a few limitations so it may be worth using puppeteer-video-recorder instead depending on the use case.