save css animation to jpeg/png in nodejs
up vote
1
down vote
favorite
I know that I can write my own animations in phaser or other framework and save jpg of that into a file, or use jimp.
https://www.npmjs.com/package/jimp
However, I would like to know if I can use css animation and then save what I see in front-end into a file in my node backend.
Is there a css engine that I can use to achieve this?
What about these? I think all of them do the animation in client side. https://blog.bitsrc.io/11-javascript-animation-libraries-for-2018-9d7ac93a2c59
I don't want to write any code for each css effect (I wrote a lot for a java application and it is still not satisfying)
css node.js animation
add a comment |
up vote
1
down vote
favorite
I know that I can write my own animations in phaser or other framework and save jpg of that into a file, or use jimp.
https://www.npmjs.com/package/jimp
However, I would like to know if I can use css animation and then save what I see in front-end into a file in my node backend.
Is there a css engine that I can use to achieve this?
What about these? I think all of them do the animation in client side. https://blog.bitsrc.io/11-javascript-animation-libraries-for-2018-9d7ac93a2c59
I don't want to write any code for each css effect (I wrote a lot for a java application and it is still not satisfying)
css node.js animation
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I know that I can write my own animations in phaser or other framework and save jpg of that into a file, or use jimp.
https://www.npmjs.com/package/jimp
However, I would like to know if I can use css animation and then save what I see in front-end into a file in my node backend.
Is there a css engine that I can use to achieve this?
What about these? I think all of them do the animation in client side. https://blog.bitsrc.io/11-javascript-animation-libraries-for-2018-9d7ac93a2c59
I don't want to write any code for each css effect (I wrote a lot for a java application and it is still not satisfying)
css node.js animation
I know that I can write my own animations in phaser or other framework and save jpg of that into a file, or use jimp.
https://www.npmjs.com/package/jimp
However, I would like to know if I can use css animation and then save what I see in front-end into a file in my node backend.
Is there a css engine that I can use to achieve this?
What about these? I think all of them do the animation in client side. https://blog.bitsrc.io/11-javascript-animation-libraries-for-2018-9d7ac93a2c59
I don't want to write any code for each css effect (I wrote a lot for a java application and it is still not satisfying)
css node.js animation
css node.js animation
asked Nov 10 at 18:47
Soley
1,1391322
1,1391322
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
In order to save a rendered animation to a file you need to record that webpage at a very high framerate, then convert all those captured frames to an animated format like GIF (jpeg and png don't support animations as far as I know).
To capture a webpage, you could try phantomjs
Here's an article that explains this: Recording a Website with phantomjs and ffmpeg
var page = require("webpage").create();
page.viewportSize = { width: 640, height: 480 };
page.open("http://www.goodboydigital.com/pixijs/examples/12-2/", function() {
setInterval(function() {
page.render("/dev/stdout", { format: "png" });
}, 25);
});
phantomjs runner.js | ffmpeg -y -c:v png -f image2pipe -r 25 -t 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart dragon.mp4
The output in this example is mp4 but you could probably tweak the command line params to get a gif.
Thanks for your very nice reply, I will mark this as answer when no one else replied in a week. You made me really happy with this!
– Soley
Nov 11 at 19:38
thanks, no problem
– mihai
Nov 11 at 19:39
What about puppeteer? I was experimenting with it, however, I don't think it can render as fast as 30fps ?
– Soley
Nov 11 at 19:58
Not sure, needs to be tested. However I found this issue: github.com/GoogleChrome/puppeteer/issues/476
– mihai
Nov 11 at 20:08
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
In order to save a rendered animation to a file you need to record that webpage at a very high framerate, then convert all those captured frames to an animated format like GIF (jpeg and png don't support animations as far as I know).
To capture a webpage, you could try phantomjs
Here's an article that explains this: Recording a Website with phantomjs and ffmpeg
var page = require("webpage").create();
page.viewportSize = { width: 640, height: 480 };
page.open("http://www.goodboydigital.com/pixijs/examples/12-2/", function() {
setInterval(function() {
page.render("/dev/stdout", { format: "png" });
}, 25);
});
phantomjs runner.js | ffmpeg -y -c:v png -f image2pipe -r 25 -t 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart dragon.mp4
The output in this example is mp4 but you could probably tweak the command line params to get a gif.
Thanks for your very nice reply, I will mark this as answer when no one else replied in a week. You made me really happy with this!
– Soley
Nov 11 at 19:38
thanks, no problem
– mihai
Nov 11 at 19:39
What about puppeteer? I was experimenting with it, however, I don't think it can render as fast as 30fps ?
– Soley
Nov 11 at 19:58
Not sure, needs to be tested. However I found this issue: github.com/GoogleChrome/puppeteer/issues/476
– mihai
Nov 11 at 20:08
add a comment |
up vote
1
down vote
In order to save a rendered animation to a file you need to record that webpage at a very high framerate, then convert all those captured frames to an animated format like GIF (jpeg and png don't support animations as far as I know).
To capture a webpage, you could try phantomjs
Here's an article that explains this: Recording a Website with phantomjs and ffmpeg
var page = require("webpage").create();
page.viewportSize = { width: 640, height: 480 };
page.open("http://www.goodboydigital.com/pixijs/examples/12-2/", function() {
setInterval(function() {
page.render("/dev/stdout", { format: "png" });
}, 25);
});
phantomjs runner.js | ffmpeg -y -c:v png -f image2pipe -r 25 -t 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart dragon.mp4
The output in this example is mp4 but you could probably tweak the command line params to get a gif.
Thanks for your very nice reply, I will mark this as answer when no one else replied in a week. You made me really happy with this!
– Soley
Nov 11 at 19:38
thanks, no problem
– mihai
Nov 11 at 19:39
What about puppeteer? I was experimenting with it, however, I don't think it can render as fast as 30fps ?
– Soley
Nov 11 at 19:58
Not sure, needs to be tested. However I found this issue: github.com/GoogleChrome/puppeteer/issues/476
– mihai
Nov 11 at 20:08
add a comment |
up vote
1
down vote
up vote
1
down vote
In order to save a rendered animation to a file you need to record that webpage at a very high framerate, then convert all those captured frames to an animated format like GIF (jpeg and png don't support animations as far as I know).
To capture a webpage, you could try phantomjs
Here's an article that explains this: Recording a Website with phantomjs and ffmpeg
var page = require("webpage").create();
page.viewportSize = { width: 640, height: 480 };
page.open("http://www.goodboydigital.com/pixijs/examples/12-2/", function() {
setInterval(function() {
page.render("/dev/stdout", { format: "png" });
}, 25);
});
phantomjs runner.js | ffmpeg -y -c:v png -f image2pipe -r 25 -t 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart dragon.mp4
The output in this example is mp4 but you could probably tweak the command line params to get a gif.
In order to save a rendered animation to a file you need to record that webpage at a very high framerate, then convert all those captured frames to an animated format like GIF (jpeg and png don't support animations as far as I know).
To capture a webpage, you could try phantomjs
Here's an article that explains this: Recording a Website with phantomjs and ffmpeg
var page = require("webpage").create();
page.viewportSize = { width: 640, height: 480 };
page.open("http://www.goodboydigital.com/pixijs/examples/12-2/", function() {
setInterval(function() {
page.render("/dev/stdout", { format: "png" });
}, 25);
});
phantomjs runner.js | ffmpeg -y -c:v png -f image2pipe -r 25 -t 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart dragon.mp4
The output in this example is mp4 but you could probably tweak the command line params to get a gif.
answered Nov 11 at 19:09
mihai
22.6k73968
22.6k73968
Thanks for your very nice reply, I will mark this as answer when no one else replied in a week. You made me really happy with this!
– Soley
Nov 11 at 19:38
thanks, no problem
– mihai
Nov 11 at 19:39
What about puppeteer? I was experimenting with it, however, I don't think it can render as fast as 30fps ?
– Soley
Nov 11 at 19:58
Not sure, needs to be tested. However I found this issue: github.com/GoogleChrome/puppeteer/issues/476
– mihai
Nov 11 at 20:08
add a comment |
Thanks for your very nice reply, I will mark this as answer when no one else replied in a week. You made me really happy with this!
– Soley
Nov 11 at 19:38
thanks, no problem
– mihai
Nov 11 at 19:39
What about puppeteer? I was experimenting with it, however, I don't think it can render as fast as 30fps ?
– Soley
Nov 11 at 19:58
Not sure, needs to be tested. However I found this issue: github.com/GoogleChrome/puppeteer/issues/476
– mihai
Nov 11 at 20:08
Thanks for your very nice reply, I will mark this as answer when no one else replied in a week. You made me really happy with this!
– Soley
Nov 11 at 19:38
Thanks for your very nice reply, I will mark this as answer when no one else replied in a week. You made me really happy with this!
– Soley
Nov 11 at 19:38
thanks, no problem
– mihai
Nov 11 at 19:39
thanks, no problem
– mihai
Nov 11 at 19:39
What about puppeteer? I was experimenting with it, however, I don't think it can render as fast as 30fps ?
– Soley
Nov 11 at 19:58
What about puppeteer? I was experimenting with it, however, I don't think it can render as fast as 30fps ?
– Soley
Nov 11 at 19:58
Not sure, needs to be tested. However I found this issue: github.com/GoogleChrome/puppeteer/issues/476
– mihai
Nov 11 at 20:08
Not sure, needs to be tested. However I found this issue: github.com/GoogleChrome/puppeteer/issues/476
– mihai
Nov 11 at 20:08
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242282%2fsave-css-animation-to-jpeg-png-in-nodejs%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown