Search code examples
webrtch.264getusermediavp8vp9

WebRtc Bandwidth / resolution / frame rate control


I want to know why I normally transmit a 320240 resolution video and default my uplink traffic is at 1.5MB; when I modify the SDP bandwidth limit, for example at 500kbps/s my video width and height are still 320240 and the frame rate is not reduced; So what exactly is this reduced upside traffic?

= =


Solution

  • WebRTC uses so-called "lossy perceptual video compression." That is, the video is capable of being compressed into bit streams of various bandwidths... in your case 1.5mbps and 0.5mbps. It's like JPEG's quality parameter: in JPEG, adjusting that parameter changes the size of the image file. In video compression, instead of a quality parameter you request a bitrate.

    When a lower-bitrate video stream is decompressed, it's a less faithful representation of the original. If you know what to look for you can see various compression artifacts in the decompressed imagery" blockiness, "mosquitoes" around objects, and so forth.

    Streaming video and DVD video programs (cinema) use high bandwidth to minimize these effects below the threshold of perception at 1080p or 4K resolution.

    In your SIF (320x240) resolution case, your decoded 0.5mbps video has more artifacts in it than your 1.5mbps video. But, because the resolution is relatively low, it will take some looking to find those artifacts. If they don't annoy you or your users, you can conclude that 0.5mbps is fine for your application. Long experience suggests that you should succeed just fine with that bitrate and resolution. You can even try 250kbps.

    Reducing the frame rate doesn't proportionally save bandwidth; most compressed video frames represent differences from the previous frame.

    Lower bitrates are better for mobile devices; they save power and your users' data plans.

    If you want to see exaggerated compression artifacts and what they look like, set the bitrate down to 125kbps or lower.