@yoannarres/puppeteer-recorder
Record animations using puppeteer. Based on electron-recorder. Custom updates for h264 output
Last updated 7 months ago by yoannarres .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @yoannarres/puppeteer-recorder 
SYNC missed versions from official npm registry.

puppeteer-recorder

Record frame-by-frame animations using puppeteer. Based on electron-recorder.

Usage

const { record } = require('@yoannarres/puppeteer-recorder');

// In this example an animation is displayed at http://0.0.0.0:4200
// The node server is then launched to record the animation to video:
const capture = async () => {
  browser = await puppeteer.launch();
  page = await browser.newPage();
  await page.goto('http://0.0.0.0:4200'); // The page to be captured
  const framerate = 10;
  const durationInSeconds = 3; // Duration of the recording
  await record({
    browser: browser, // Optional: a puppeteer Browser instance,
    page: page, // Optional: a puppeteer Page instance,
    output: 'output.avi',
    fps: framerate,
    selectedElement: '#myUniqueId', // Optional, should be unique; limits the render to specified DOM element
    logEachFrame: true, // Optional, FFMPEG logging info if true
    frames: framerate * durationInSeconds, // 3 seconds at 10 fps
    prepare: function(browser, page) {
      /* executed before first capture */
    },
    render: function(browser, page, frame) {
      /* executed before each capture */
    }
  });
};

capture();

Lint

npm run lint

Current Tags

  • 0.0.8                                ...           latest (7 months ago)

8 Versions

  • 0.0.8                                ...           7 months ago
  • 0.0.7                                ...           7 months ago
  • 0.0.6                                ...           7 months ago
  • 0.0.5                                ...           7 months ago
  • 0.0.4                                ...           7 months ago
  • 0.0.3                                ...           7 months ago
  • 0.0.2                                ...           7 months ago
  • 0.0.1                                ...           7 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |