Change webRTC quality

This question does not ask the resolution and frameRates question on getUserMedia() .

This is about how to reduce / increase the quality of one frame in a video when using getUserMedia() .

Here's a demo using getUserMedia ().

How to change video quality? //Please Fiddle answer.

code:

 var video_constraints = {mandatory: { maxWidth: 320, maxHeight: 240, maxAspectRatio:4/3, maxFrameRate:1 }, optional: [ ] }; var constraints = {audio: true, video: video_constraints }; navigator.getUserMedia(constraints, successCallback, errorCallback); 
+6
source share
1 answer

If there is no resolution or frame rate, I assume that you are talking about data transfer speed or camera settings (white balance, exposure, contrast, etc.).

The video stream provided by getUserMedia should provide you with uncompressed video with the highest quality available from the camera hardware. Unable to configure camera settings; they are fully automated, controlled by the camera driver and / or operating system. If you want to adjust the image, you can process it using the canvas using a 2d or webgl context. There are several libraries that will help you with this.

As for the data transfer rate, this becomes a problem only when transmitting video through a peer-to-peer connection. This is also done adaptively and automatically.

Regardless of the quality and size of the media streams provided, the network stack implements its own flow and congestion control algorithms: each connection starts with streaming audio and video with a low bit rate (<500 Kbps), and then starts adjusting the quality of the streams according to the available bandwidth .

Source: High Performance Browser Network

+2
source

Source: https://habr.com/ru/post/970856/


All Articles