title: How to Extract Frames from the uploaded video through ffmpeg using node js?
body: <p>I have created application in which user uploads a video , from that video i want to extract 50 images using ffmpeg in nodejs, but i am unable to get that file after uploading it in specific folder. I am uploading video through multer as it stores video in specified folder, after that i read that video using read stream but it is not giving proper information on that particular video</p>
  <p>Code:</p>
  <pre><code>var express = require('express');
  
  var app = express();
  
  var bodyParser = require('body-parser');
  
  var path = require('path');
  
  var multer = require('multer');
  
  var cfenv = require('cfenv');
  
  var watson = require('watson-developer-cloud');
  
  var ffmpeg = require('ffmpeg');
  
  app.use(bodyParser.json());
  
  app.use(bodyParser.urlencoded({&quot;extended&quot;: false}));
  
  app.use(express.static(__dirname + '/public'));
  
  var storage = multer.diskStorage({
      destination: function(req, file, callback){
          callback(null, './public/class'); // set the destination
      },
      filename: function(req, file, callback){
          callback(null, 199212+ '.avi'); // set the file name and extension
      }
  });
  
  var upload = multer({storage: storage});
   
   app.upload = upload;
   
   // get the app environment from Cloud Foundry
   var appEnv = cfenv.getAppEnv();
  
  var VisualRecognitionV3 = require('watson-developer-cloud/visual-recognition/v3');
  
  var fs = require('fs');
  
  
  var visualRecognition = new VisualRecognitionV3({
    version: '2018-03-19',
    iam_apikey: 'aaIFu-fHWBXgj09eVarEQUFlIaTeH9bpgvRqHIJxu_8N'
  });
  
  
  app.post('/imgtable',app.upload.single('video-upl'),function(req,res){
                  
      var video_file = fs.createReadStream(req.file.path);
                                      
   try {
      var process = new ffmpeg('./public/class/199212.avi');
      process.then(function (video) {
          // Video metadata
          console.log('******************************');
          console.log(video);
          // FFmpeg configuration
          console.log('*********************************');
          console.log(video.info_configuration);
      }, function (err) {
          console.log('Error: ' + err);
      });
  } catch (e) {
      console.log(e.code);
      console.log(e.msg);
  }
  
      
  })
  
  app.listen(3000);`
  </code></pre>