webrtc frame rate and size;






https://webrtchac

om/video-constraints-2/

https://webrtchacks.com/how-to-figure-out-webrtc-camera-resolutions/


Try maxWidth/maxHeight constraints:

var video_constraints = {
   mandatory: {
       maxHeight: 480,
       maxWidth: 640 
   },
   optional: []
};

navigator.getUserMedia({
   audio: false,
   video: video_constraints
}, onsuccess);

Updated (Sep 26, 2013):

According to this page; you can set following resolutions (min/max width/height):

1920:1080
1280:720
960:720
640:360
640:480
320:240
320:180

Or Maybe:

1280:800
1280:720
960:600
960:540
640:400
640:360
640:480
480:300
480:270
480:360
320:200
320:180
320:240
240:150
240:135
240:180
160:100
160:90
160:120


分辨率最高的是WVGA:800×480
VGA为标准分辨率:640×480
WVGA 分辨率:800×480

WQVGA 分辨率:480×320
QVGA分辨率:320×240
D1 分辨率:720×576
CIF 分辨率: 352×288
QCIF 分辨率:176×144

Openwebrtc:

QCIF and QVGA are unusable and result in an oddly shaped black frame on the receiving end in Chrome.

CIF works and reduces the latency to 0.5 s or so initially, however latency gradually increases to several seconds and longer.



getUserMedia() constraints

As covered in the What happens when there’s missing media sources? post, getUserMedia() takes a constraints object. The object, as defined in the getUserMedia()W3C specification looks like this:

The spec allows mandatory and optional constraints for both minimum and maximums on:

ObjectWhat it doesValue options
HeightSpecifies the video source heightMin and Max of an integer
WidthSpecifies the video source widthMin and Max of an integer
FrameRatespecify how many frames to send per second (usually 60 for HD, 30 for SD)Min and Max of an integer
aspectRatioheight divided by width – usually 4/3 (1.33333333333) or 16/9 (1.7777777778)Min and Max of an decimal
facingModeSelect the front/user facing camera or the rear/environment facing camera if availableWhich camera to choose – currently user, environment, left, or right

In addition to turning audio and video on/off all together, in practice minHeight, minWidth, maxHeight, and maxWidth variables are the most widely supported:

I have also seen reference to others that could theoretically be passed down to the libjingle media engine that powers WebRTC. These are out of scope for my camera resolution project, so I did not experiment with them.











  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值