title: Cannot merge videos with express using ffmpeg: Cannot use 'in' operator to search for 'readable' in undefined
body: <p>The goal is to save video files into <strong>api/videos/result</strong> and then merge all videos in that folder into one video.</p>
  
  <p>The npm module <strong>fluent-ffmpeg</strong> is throwing the error:</p>
  
  <pre><code>TypeError: Cannot use 'in' operator to search for 'readable' in undefined
      at FfmpegCommand.proto.mergeAdd.proto.addInput.proto.input (C:\Users\vmadmin\Desktop\M152-Frontend\node_modules\fluent-ffmpeg\lib\options\inputs.js:33:24)
      at C:\Users\vmadmin\Desktop\M152-Frontend\server.js:36:35
      at Array.forEach (&lt;anonymous&gt;)
      at C:\Users\vmadmin\Desktop\M152-Frontend\server.js:30:12
      at Layer.handle [as handle_request] (C:\Users\vmadmin\Desktop\M152-Frontend\node_modules\express\lib\router\layer.js:95:5)
      at next (C:\Users\vmadmin\Desktop\M152-Frontend\node_modules\express\lib\router\route.js:137:13)
      at Array.&lt;anonymous&gt; (C:\Users\vmadmin\Desktop\M152-Frontend\node_modules\multer\lib\make-middleware.js:53:37)
      at listener (C:\Users\vmadmin\Desktop\M152-Frontend\node_modules\on-finished\index.js:169:15)
      at onFinish (C:\Users\vmadmin\Desktop\M152-Frontend\node_modules\on-finished\index.js:100:5)
      at callback (C:\Users\vmadmin\Desktop\M152-Frontend\node_modules\ee-first\index.js:55:10)
  </code></pre>
  
  <p>I am not sure what to do with this error. I do neither have 'in' nor 'readable' somewhere in my code, so there wasn't anything specific for me to try.</p>
  
  <pre class="lang-js prettyprint-override"><code>var mergedVideo = ffmpeg();
  var upload = multer({storage: storage});
  var single = upload.single('MyVideo');
  var fs = require('fs');
  
  });
  // POST Request. Video is being uploaded here
  app.post('/api/videos', single, function (req, res) {
      // Declares variable, that saves an array from all elements in result folder
      var source = fs.readdirSync('./api/videos/result/');
      // Loop, which iterates through each element in result folder
      source.forEach(function (element) {
          // Merge 'api', 'videos' and 'result' to one path
          var pathJoin = path.join('api', 'videos', 'result');
          // Save complete path with file in one variable
          var finalPath = console.log(__dirname + '\\' + pathJoin + '\\' + element);
          // Adds each file into the input for merging
          mergedVideo = mergedVideo.addInput(finalPath);
      });
      // Merge files and save them as merged.mp4
      mergedVideo.mergeToFile('./api/videos/merged.mp4', '/api/videos/tempDir/')
          .on('error', function (err) {
          console.log('Error ' + err.message);
      })
          .on('end', function () {
          console.log('Finished!');
      });
      res.send(console.log('Hallo!'));
  });
  </code></pre>
  
  <p>Expected a file named <strong>merged.mp4</strong> in the <strong>api/videos</strong> folder.</p>