title: Cutting a video without re encoding using ffmpeg and nodejs (fluent-ffmpeg)
body: <p>I have a quick question,
  I'm trying to do a cloud video editor, and i want to be able to cut out video usng nodejs.</p>
  <p>I'm using <a href="https://github.com/fluent-ffmpeg/node-fluent-ffmpeg" rel="nofollow noreferrer">fluent-ffmpeg</a>. Here is my code :</p>
  <pre class="lang-js prettyprint-override"><code>const cutVideo = async (sourcePath, outputPath, startTime, duration) =&gt; {
    console.log('start cut video');
  
    await new Promise((resolve, reject) =&gt; {
      ffmpeg(sourcePath)
        .setFfmpegPath(pathToFfmpeg)
        .setFfprobePath(ffprobe.path)
        .output(outputPath)
        .setStartTime(startTime)
        .setDuration(duration)
        .on('end', function (err) {
          if (!err) {
            console.log('conversion Done');
            resolve();
          }
        })
        .on('error', function (err) {
          console.log('error: ', err);
          reject(err);
        })
        .run();
    });
  };
  </code></pre>
  <p>It's working but not optimal, and as soon as i try to edit to a long video (getting 10 min from a video instead of 1 min out) it's super long.</p>
  <p>What i understand is that ffmpeg re encode everything, so that's why the longer the edit is the longer the process will.
  Is there  way to cut out using node-fluent-ffmpeg without re encoding everything ?</p>
  <p>Thanks to the community !</p>