SamuelScheit / puppeteer-stream

A Library for puppeteer to retrieve audio and/or video streams
MIT License
335 stars 105 forks source link

Recording is taking alot of CPU #43

Closed varunk29 closed 1 year ago

varunk29 commented 2 years ago

is there any way to optimize it, it seems to take a lot of CPU when I start recording,

SamuelScheit commented 2 years ago

If you don't need audio, I recommend the chrome dev tools screencast API, which has better performance. You can use it with the puppeteer-screen-recorder package.

varunk29 commented 2 years ago

ill need audio, I'm trying to record a webrtc call

varunk29 commented 2 years ago

I see you're using an extension for recording audio and video,

SamuelScheit commented 2 years ago

https://github.com/Flam3rboy/puppeteer-stream/issues/4#issuecomment-1086873979

iopanio commented 2 years ago

In PuppeteerStream.js, opts.frameSize is set to 20 by default. It is then passed toextension/background.js where it is consumed by recorder.start(opts.framesize). Set opts.frameSize to >= 1000. It should generate a Blob every 1000ms, not every 20ms.

varunk29 commented 2 years ago

I tried that, but it still didn't help in reducing CPU usage

JpEncausse commented 2 years ago

Hello, I have the same issue here, I try to record an HTML page in 720P (down from 1080) on Azure Machine The page display ThreeJS + Audio + Video content. The result is very slow and I don't know where I can optimize something (appart from a better CPU)

SamuelScheit commented 1 year ago

I've rewritten the transmission method in c420bc4 and it should now use a lot less CPU