W
W
Wasya UK2019-01-30 14:06:33
fmpeg
Wasya UK, 2019-01-30 14:06:33

How to intercept video recording in FFMPEG?

Is it possible to intercept frames when writing desktop by type: .on(data => { do something }) in Node?
I found the opportunity to both write to the RAM and to the disk via ffmpeg, I do this:

const command = ffmpeg('desktop')
  .duration(30)
  .size('1920x1080')
  .inputFPS(25)
  .addInputOption('-f gdigrab')
  .on('progress', e => {
    console.log(e)
  })
  .on('end', () => {
    console.log('Done!')
  })
  .on('error', err => {
    console.error(err.message)
  })
  .save(path.resolve(__dirname, 'files', 'output.mpg'))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question