Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to increase video quality #162

Open
theorchids opened this issue May 28, 2024 · 2 comments
Open

Unable to increase video quality #162

theorchids opened this issue May 28, 2024 · 2 comments

Comments

@theorchids
Copy link

theorchids commented May 28, 2024

Can someone help me with it, video quality is very low & file size is low (< 250 kb)
Here is my code

  const file = fs.createWriteStream(`./videos/vid-${new Date().getMilliseconds()}.webm`);
  const browser = await launch({
    executablePath: "C:/Program Files/Google/Chrome/Application/chrome.exe",
    args: ["--autoplay-policy=no-user-gesture-required"],
    defaultViewport: {
      width: 1536,
      height: 703,
    },
    headless: "new",
  });

  const page = await browser.newPage();
  await page.goto("http://localhost:3000?capture=true");
  const stream = await getStream(page, {
    audio: true,
    video: true,
    // bitsPerSecond: 100000000,
    videoConstraints: {
      mandatory: {
        width: 1536,
        height: 703,
        frameRate: 60,
        facingMode: "environment",
        advanced: [{ width: 1920, height: 1280 }, { aspectRatio: 1.333 }],
      },
    },
  });
  const element = await page.waitForSelector(".playBtn");

  element?.click();
  stream.pipe(file);
  setTimeout(async () => {
    await stream.destroy();
    file.close();
    console.log("finished");

    await browser.close();
    (await wss).close();
  }, 1000 * 10);
}
@JasonOneYuan
Copy link

Same problem.
Is this a bug or somewhere setting problem?

@JOEMN96
Copy link

JOEMN96 commented Jun 27, 2024

Same issue, Anyone have any fixes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants