如何使用 getDisplayMedia api 设置高清屏幕录制?

发布于 2025-01-10 06:42:24 字数 517 浏览 6 评论 0原文

我使用 getDisplayMedia() API 创建了一个屏幕录像机应用程序,但输出视频质量不好,有什么方法可以配置输出视频质量以获得高清分辨率视频?

我有一个类似的问题 -> https://groups.google.com/g/discuss-webrtc/c /-KC3xg4MEp4 但解决方案不可用

var constraints = {
  audio: false,
  video: {
    width: { ideal: 720, max: 1920 },
    height: { ideal: 1024, max: 1080 }
  }
}
video_stream = await navigator.mediaDevices.getDisplayMedia(constraints);

I have created a screen recorder application using getDisplayMedia() API but the output video quality is not good, is there any way to configure the output video quality to get HD resolution video?

I got a similar kind of question -> https://groups.google.com/g/discuss-webrtc/c/-KC3xg4MEp4 but solution is not available

var constraints = {
  audio: false,
  video: {
    width: { ideal: 720, max: 1920 },
    height: { ideal: 1024, max: 1080 }
  }
}
video_stream = await navigator.mediaDevices.getDisplayMedia(constraints);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清醇 2025-01-17 06:42:25

我得到了答案,为了设置良好的分辨率,只需更新约束,输出视频质量就会更好。

var constraints = {
  audio: false,
  video: {
    width: { ideal: 1920, max: 1920 },
    height: { ideal: 1080, max: 1080 }
  }
}

I got the answer, in order to set the good resolution just update the constraint and the output video quality will be better.

var constraints = {
  audio: false,
  video: {
    width: { ideal: 1920, max: 1920 },
    height: { ideal: 1080, max: 1080 }
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文