webrtc frame rate and size;

来源:互联网 发布:淘宝上便宜衣服来源 编辑:程序博客网 时间:2024/04/27 15:18






https://webrtchac

om/video-constraints-2/

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


6 down vote

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:10801280:720960:720640:360640:480320:240320:180

Or Maybe:

1280:8001280:720960:600960:540640:400640:360640:480480:300480:270480:360320:200320:180320:240240:150240:135240:180160:100160:90160:120


分辨率最高的是WVGA:800×480VGA为标准分辨率:640×480WVGA 分辨率:800×480WQVGA 分辨率:480×320QVGA分辨率:320×240D1 分辨率:720×576CIF 分辨率: 352×288QCIF 分辨率: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 optionsHeightSpecifies the video source heightMin and Max of an integerWidthSpecifies the video source widthMin and Max of an integerFrameRatespecify how many frames to send per second (usually 60 for HD, 30 for SD)Min and Max of an integeraspectRatioheight divided by width – usually 4/3 (1.33333333333) or 16/9 (1.7777777778)Min and Max of an decimalfacingModeSelect 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
原创粉丝点击