Im Taking screen shots from a url, using phantomjs using the setIntreval function (25 right now) and then piping the output to the ffmpeg (Using the frame rate -r 24). Here is the Code. ffmpeg.js
var page = require('webpage').create();
page.viewportSize = { width: 1024, height: 768 };
page.open('http://ewoken.github.io/Leaflet.MovingMarker/', function () {
setInterval(function() {
page.render('/dev/stdout', { format: "png" });
}, 25);
});
Then I run the script using this.
phantomjs ffmpeg.js | ffmpeg -y -c:v png -f image2pipe -r 24 -t 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart output.mp4
Like In the command Im getting the 10 sec video with the page, But Its all speeding up fast first and completely freezes with a last frame.
Can you guys help me, with a work around, enabling me to record the page , AS IS ? Like if there is a 3000 delay animation in the movie, It should appear like real in the movie, like smooth and in real time.
Thank you guys. Stuck on this for a long time now.
Cheers,
First of all, you need to have ffmpeg with the
--enable-x11grab
option, you need to compile it.configuration:
We need to use SlimerJS, it's not a headless browser, but scriptable as well:
For slimerjs, we need to install the following
snap.js
script:rm -f snap.js; nano snap.js; chmod +x snap.js; clear
Now, we need to install
x virtual frame buffer
and some libraries for firefox:Now we need to add new virtual display 1.1:
Try to run
firefox
without any option, to make sure that no additional library needed (it's normal if there will be some errors in the output):Then, we can use the script:
I've got this video:
https://drive.google.com/open?id=0B_tqnSHhFPBndDJ0Y1c5THBKWkk
Note: if you are using 32-Bit Linux, you need to replace the link:
With the following: