Meteor-CollectionFS icon indicating copy to clipboard operation
Meteor-CollectionFS copied to clipboard

Video to Image Thumbnails using CollectionFS in Meteor.JS

Open manusharma1 opened this issue 10 years ago • 2 comments

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

manusharma1 avatar Aug 27 '15 07:08 manusharma1

+1

okpatil4u avatar Oct 05 '15 06:10 okpatil4u

Hello Mate, Have you got any solution?

rashmimhatre100 avatar Jul 26 '17 11:07 rashmimhatre100