title: Can't save ffmpeg output in Nodejs
body: <p>I have a problem with saving the preview from the .mp4 file. I followed this <a href="https://blog.logrocket.com/generating-video-previews-with-node-js-and-ffmpeg/" rel="nofollow noreferrer">tutorial</a>, but I got the <strong>Error: ffmpeg exited with code 1: C:\Users\Lenovo\Documents\My projects\YouTube\routes: Permission denied</strong>. I don't know how to deal with it, the 'outputPath' is simple<strong>strong text</strong> &quot;public/uploads/previews&quot;. I am on Windows 10.</p>
  <pre><code>return ffmpeg()
              .input(inputPath)
              .inputOptions([`-ss ${startPreviewInSec}`])
              .outputOptions([`-t ${previewDurationInSec}`])
              .noAudio()
              .format(&quot;gif&quot;)
              .output(outputPath)
              .on(&quot;end&quot;, resolve)
              .on(&quot;error&quot;, reject)
              .run();
  </code></pre>