puppeteer-stream
puppeteer-stream copied to clipboard
[Question] How can you specify the quality of video?
are the options
audioBitsPerSecond
videoBitsPerSecond
bitsPerSecond
frameSize
the things that manage video quality? what do I need to choose if I want 4k or 1080p? also, does frame size specify the frame rate? like 60fps?
These options are quality options for encoding: https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder To change the resolution pass the videoConstraints option
videoConstraints: {
mandatory: {
minWidth: 1920,
minHeight: 1080,
minFrameRate: 60
}
}
and change the page viewport:
await page.setViewport({
width: 1920,
height: 1080
})
I'm on version 2.1.1 of puppeteer-stream, and I don't see an option called videoConstraints, where should I put it?
you can specify them for audio/video in the getStream options:
getStream(page, {
video: {
mandatory: {
minWidth: 1920,
minHeight: 1080,
minFrameRate: 60
}
}
})