SamuelScheit / puppeteer-stream

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

Can you fix the background.js? (Screen resolution problem) #30

Closed wesias7 closed 2 years ago

wesias7 commented 2 years ago
function START_RECORDING({ index, video, audio, frameSize, audioBitsPerSecond, videoBitsPerSecond, bitsPerSecond, mimeType, videoConstraints }) {
    chrome.tabCapture.capture(
        {
            audio,
            video,
            videoConstraints: videoConstraints || {}
        },

then,

const videoConstraints = { mandatory: { minWidth: 480, minHeight: 680, maxWidth: 480, maxHeight: 680 } }
const stream = await puppeteerStream.getStream(page, { audio: true, video: true, videoConstraints })
console.log("recording")

videoConstraints: {
      mandatory: {
          minWidth: 1920,
          minHeight: 1080,
          maxWidth: 1920,
          maxHeight: 1080
      }
  }

If you let me put the video constant value in, the problem will be solved. Make sure to write down the size you want.

Nice program. I'll use it well.

natashafenech commented 2 years ago

I can confirm this works, any plans for this to get fixed?

wesias7 commented 2 years ago

@natashafenech If reflected, even a small screen can be recorded. I'm using it.

cdemi commented 2 years ago

@Flam3rboy shall we attempt to make a Pull Request for this fix?

SamuelScheit commented 2 years ago

Yes, I would love to merge it 👍

natashafenech commented 2 years ago

Perfect, just opened PR: https://github.com/Flam3rboy/puppeteer-stream/pull/32