gifshot
gifshot copied to clipboard
How to use gifshot to create animated gif from frames(base64 img) on NodeJS?
How to use gifshot to create animated gif from frames(base64 img) on NodeJS? Now print error: Canvas elements are not supported in your browser
var express = require('express');
var gifshot = require('gifshot');
var app = express();
var bodyParser = require('body-parser');
var urlencodedParser = bodyParser.urlencoded(({ limit: '200mb', extended: true, parameterLimit: 100 }));
app.post('/', urlencodedParser, function(req,res){
var imgFramesBase64 = JSON.parse(req.body.images);
gifshot.createGIF({
images: imgFramesBase64,
interval: 0.04,
numFrames: 10,
frameDuration: 1,
gifWidth: 200,
gifHeight: 200,
sampleInterval: 10,
numWorkers: 2
},function(obj) {
if(!obj.error) {
res.send(obj.image);
} else {
res.send(obj.errorMsg);
}
});
});
app.listen(3333);
Did you make any progress on that? I also would like to move the heavy lifting to the server.
Did you make any progress on that? I also would like to move the heavy lifting to the server.
I chose a different way! I send frames from canvas to the server, and on the server I send them to ffmpeg :)
Did you make any progress on that? I also would like to move the heavy lifting to the server.
I chose a different way! I send frames from canvas to the server, and on the server I send them to ffmpeg :)
Yeah I'm still busy on this...
I have now a decent GIF, but my ffmpeg from base64 gif to .mov
results in End of file
and frustrates me.
Care to share your gif to mp4 solution?
Did you make any progress on that? I also would like to move the heavy lifting to the server.
I chose a different way! I send frames from canvas to the server, and on the server I send them to ffmpeg :)
Yeah I'm still busy on this... I have now a decent GIF, but my ffmpeg from base64 gif to .mov results in
End of file
and frustrates me.Care to share your gif to mp4 solution?
My goal was to make a GIF animation from images. So I don’t know how to make MP4 from GIF animation.
Did you make any progress on that? I also would like to move the heavy lifting to the server.
I chose a different way! I send frames from canvas to the server, and on the server I send them to ffmpeg :)
Are you able to share your solution?
Did you make any progress on that? I also would like to move the heavy lifting to the server.
I chose a different way! I send frames from canvas to the server, and on the server I send them to ffmpeg :)
Are you able to share your solution?
Everything is very simple. With an Ajax POST (stuffing them into formdata js), I send a few frames to the server. Taking with PHP (using move_uploaded_file) I copy them to the folder. And then I use ffpmeg on the server to collect all the pictures into animation (for example: ffmpeg -f image2 -framerate 10 -i thumb /% 001d.jpg -vf scale = 480x240 out.gif)