问题描述
我尝试和,但我能得到的最大分辨率是640x480。
图片由同一台相机拍摄的其他Windows应用程序的分辨率为1600x1200。
WebRTC的分辨率是否有任何限制?
我找不到任何关于此的官方文档。
I tried this and this, but the maximum resolution I can get is 640x480.
The pictures taken by other windows apps by the same camera have the resolution of 1600x1200.
Is there any limit for resolution in WebRTC?
I cannot find any official documentation about that.
推荐答案
您可以使用约束并将这些约束传递给getUserMedia,如您提供的链接所示。您的网络摄像头可能仅支持640x480用于视频和更高分辨率的静止图像(这很常见)。
You can do it by using constraints and passing those to getUserMedia as shown in the links you provided. It's possible that your webcam only supports 640x480 for video and higher resolutions for still images (this is common).
这是另一个示例,您可以尝试设置各种分辨率,它将打印出相应的约束对象:
Here's another example, where you can try setting various resolutions and it will print out the corresponding constraints object: http://webrtc.googlecode.com/svn/trunk/samples/js/demos/html/constraints-and-stats.html
例如,试图强迫它以30FPS到720p:
For example, to try to force it to 720p at 30FPS:
{
"audio": true,
"video": {
"mandatory": {
"minWidth": "1280",
"maxWidth": "1280",
"minHeight": "720",
"maxHeight": "720",
"minFrameRate": "30"
},
"optional": []
}
}
请注意,由于对指纹识别引起的隐私担忧,当前规范不允许查询硬件功能:
Note that the current spec does not allow querying the hardware capabilities, due to concerns over privacy due to fingerprinting: http://lists.w3.org/Archives/Public/public-media-capture/2012Jan/0014.html
这篇关于WebRTC分辨率限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!