Output with label 'screen0' does not exist in any defined filter graph, or was already used e

Questions involving a Windows version of FFmpeg.
Post Reply
mandaputtra
Posts: 1
Joined: Sun Apr 28, 2019 10:51 am

Output with label 'screen0' does not exist in any defined filter graph, or was already used e

Post by mandaputtra » Sun Apr 28, 2019 10:57 am

I used fluent-ffmpeg for take videos per-frame, but its yelling error

Code: Select all

Output with label 'screen0' does not exist in any defined filter graph, or was already used e
. there are 600 length array thaat contains timestamps.. The code that I use is below,.

Code: Select all

// read json 600 length array
fs.readFile(`${config.videoProc}/timestamp/1.json`, 'utf8', async (err, data) => {
  if (err) throw new Error(err.message);
  const timestamp = JSON.parse(data);
  // screenshot happens here
  function takeFrame() {
    command.input(`${config.publicPath}/static/video/1.mp4`)
      .on('error', error => console.log(error.message))
      .on('end', () => {
        if (timestamp.length > 0) {
        // take again if there is still array
          takeFrame();
        } else {
          console.log('Process ended');
        }
      })
      .noAudio()
      .screenshots({
        timestamps: timestamp.splice(0, 100),
        filename: '%i.png',
        folder: '../video/img',
        size: '320x240',
      });
  }
  // call the function
  takeFrame();
});
Any idea why?

Post Reply