2
我一直在尝试使用phantomjs或slimerjs从网站捕捉一系列png,然后将输出发送到/ dev/stdout并将其传输到ffmpeg来制作视频。phantomjs/slimerjs输出到标准输出为空
像这样:
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);
});
但我没有得到在标准输出上不惜一切代价,试图在这个最新的Ubuntu和Debian喘息与端口的node.js和从git编译的node.js。与npm install -g phantomjs
我猜这是一个错误,试图寻找自己的GitHub的问题跟踪,但也有1000 +开放性问题安装
phantomjs,我想如果我真的是打开票前检查正确地做事。
谢谢。
顺便说一句,你的节点版本有无关PhantomJS。它不是节点模块,但为了方便起见,只能通过npm安装。 –