title: 'ffmpeg' is not recognized as an internal or external command in nodejs node-ffmpeg
body: <p>I am developing a Node.js application. First of all, I am just a beginner when it comes to Node.</p>
  <p>What I am doing in my application now is that I am trying to create the thumbnail JPEG file for my mp4 file. I have already tried many possible solutions. Now I am using this one - <a href="https://github.com/damianociarla/node-ffmpeg" rel="nofollow noreferrer">https://github.com/damianociarla/node-ffmpeg</a>. I think this is the potential solution among all. I am getting the error when I generate the JPEG thumbnail of the video file.</p>
  <p>Here is what I have done so far. I installed the package running this command</p>
  <pre><code>npm install ffmpeg --save
  </code></pre>
  <p>Then I try to generate the thumbnail files like this</p>
  <pre><code>var ffmpeg = require('ffmpeg');
  module.exports.createVideoThumbnail = function(req, res)
  {
      try {
          var process = new ffmpeg('public/lalaland.mp4');
          process.then(function (video) {
              
              video.fnExtractFrameToJPG('public', {
                  frame_rate : 1,
                  number : 5,
                  file_name : 'my_frame_%t_%s'
              }, function (error, files) {
                  if (!error)
                      console.log('Frames: ' + files);
                  else
                      //This error message is displayed
                      console.log(error)
              });
  
          }, function (err) {
              console.log('Error: ' + err);
          });
      } catch (e) {
          console.log(e.code);
          console.log(e.msg);
      }
      res.json({ status : true , message: &quot;Video thumbnail created. Hopefully&quot; });
  }
  </code></pre>
  <p>When I run the code, it is throwing an error. I commented in the code where the error is thrown from.
  This is the error message</p>
  <pre><code>{ Error: Command failed: ffmpeg -i public/lalaland.mp4 -r 1 -s 0x0 -aspect NaN:NaN -vframes 5 -filter_complex &quot;scale=iw*sar:ih, pad=max(iw\,ih*(NaN/NaN)):ow/(NaN/NaN):(ow-iw)/2:(oh-ih)/2:black&quot; public/my_frame_1518211962631_0x0_%d.jpg
  'ffmpeg' is not recognized as an internal or external command,
  operable program or batch file.
  
      at ChildProcess.exithandler (child_process.js:275:12)
      at emitTwo (events.js:126:13)
      at ChildProcess.emit (events.js:214:7)
      at maybeClose (internal/child_process.js:925:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
    killed: false,
    code: 1,
    signal: null,
    cmd: 'ffmpeg -i public/lalaland.mp4 -r 1 -s 0x0 -aspect NaN:NaN -vframes 5 -filter_complex &quot;scale=iw*sar:ih, pad=max(iw\\,ih*(NaN/NaN)):ow/(NaN/NaN):(ow-iw)/2:(oh-ih)/2:black&quot; public/my_frame_1518211962631_0x0_%d.jpg' }
  </code></pre>
  <p>I installed the ffmg as well. You can see below it is an installed command on my laptop</p>
  <p><a href="https://i.stack.imgur.com/uEBFA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uEBFA.png" alt="enter image description here" /></a></p>
  <p>What is missing in my code?</p>