Video to Image Thumbnails using CollectionFS in Meteor.JS
Hi All,
I am using Meteor CollectionFS in one of my projects, When I Use Image Uploads the thumbnails are getting generated.
Is it possible to create thumbnails for Videos using gm?
I am curious as I found one answer for it at : http://superuser.com/questions/599348/can-imagemagick-make-thumbnails-from-video
But how to use it in Meteor CollectionFS?
Here is what I am trying to do with Video Uploads
VideoFileCollection = new FS.Collection("VideoFileCollection", {
stores: [
new FS.Store.FileSystem("videos", {path: "/uploads/videos"}),
new FS.Store.FileSystem("videosthumbs", {path: "/uploads/videosthumbs",
beforeWrite: function(fileObj) {
// We return an object, which will change the
// filename extension and type for this store only.
return {
extension: 'png',
type: 'image/png'
};
},
transformWrite: function(fileObj, readStream, writeStream) {
gm(readStream, fileObj.name()).convert(10).stream('PNG').pipe(writeStream);
}
})
]
});
What I am getting is this :
Under "videos" folder video is getting successfully uploaded
But under "videosthumbs" folder I am getting a 0 Byte PNG image
The issue is that how to convert video formats to thumbnails?
Please advise the solution.
Waiting for your response.
Thanks and Regards
+1
Hello Mate, Have you got any solution?