I'm trying to record a webpage using NodeJs. I am using PhantomJs to take screenshots of the page and ffmpeg to conver them to video. The problem is that the page I'm using uses 3d transform css, and PhantomJs does not support 3d transforms () and everything seems static. Is there any alternative to PhantomJs that supports 3d transforms? Or maybe a different approach?

It's not necessary to be NodeJs, other languages like Python works too.

Here's the code I'm using right now:

var page = require("webpage").create(); page.viewportSize = { width: 500, height: 860 }; page.open("pageurl", function() { // Initial frame var frame = 0; // Add an interval every 25th second setInterval(function() { // Render an image with the frame name page.render("frames/dragon" + frame++ + ".png", { format: "png" }); // Exit after 50 images if (frame > 100) { phantom.exit(); } }, 25); }); 

3 Answers

Phantom JS is no longer being maintained so I would suggest using something like puppeteer which uses headless chrome and gives you the ability to do what you're requesting.

2

OBS supports this by way of Chromium Embedded Framework. There is an API for OBS, or you can use CEF directly.

An alternative method that I use is the Tab Capture API, by way of browser extension.

Have you tried using puppeteer. It uses chrome and its super fast

They have a simple example code in their readme file

(async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('); await page.screenshot({path: 'example.png'}); await browser.close(); })(); 

Run this code here:

Also find more information about the screenshot command in the docs

Good luck!

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.