kldzj / puppeteer-stream

Screen capture puppeteer pages using either CDP tools or fmmpeg's x11grab
https://npmjs.com/@kldzj/puppeteer-stream
10 stars 1 forks source link

Fluent-ffmpeg spawn process called twice if pipe() used #1

Open luigixx73 opened 9 months ago

luigixx73 commented 9 months ago

Please check out this code in /base/transcoder.ts. Lines 105 -- As using pipe() involves run() it is called twice spawning the process twice and producing 2 output streams which mess the resulting video in gliches. So, a good solution is to put that part of code inside the else { } block when there is no custom output function.

this._promise = new Promise((resolve) => { this._command.on('end', resolve).run(); });

kldzj commented 9 months ago

Hey there, thanks for spotting this issue.

Would you mind creating a PR for this?