2

I've been trying to capture a sequence of pngs from a website using phantomjs or slimerjs, then send the output to /dev/stdout and pipe it to ffmpeg to make a video.

Like so:

phantomjs test.js | ./ffmpeg -analyzeduration 2147483647 -probesize 2147483647 -y -c:v png -f image2pipe -r 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart test.mp4

test.js:

var page = require('webpage').create();

page.clipRect = { top: 0, left: 0, width: 900, height: 800};
page.viewportSize = { width: 900, height: 800};

var url = 'http://dl.dropbox.com/u/621993/voronoi/voronoi.html';
var frames = 50;

page.open(url, function(){
    setInterval(function(){
        page.render('/dev/stdout');

        if( frames == 0 ) {
            phantom.exit();
        }

        frames--;
    }, 100);
});

But i don't get absolutely anything on stdout, tried this on latest ubuntu and debian wheezy with node.js from ports and node.js compiled from git.

phantomjs installed with npm install -g phantomjs

I'm guessing this is a bug, tried looking on their github issue tracker but there are 1000+ open issues, i would like to check before opening a ticket if i'm actually doing things right.

Thank you.

zetsubou
  • 23
  • 4
  • By the way, your node version has nothing to do with PhantomJS. It isn't a node module, but is only installed through npm for convenience. – Artjom B. Dec 06 '14 at 18:01

1 Answers1

0

It seems that phantomjs has some troubles of acquiring the complex html/js on the page (very beautiful by the way), if you try other URL for ex. http://www.goodboydigital.com/pixijs/examples/12-2/ and slightly different command and recent ffmpeg it just works ;)

phantomjs test.js | ffmpeg-2.4.2-64bit-static/ffmpeg -y -c:v png -f image2pipe -r 25 -t 10  -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart test.mp4
Igor
  • 2,619
  • 6
  • 24
  • 36