MediaStream Recording API Video Bitrates

MediaRecorder Video Bitrates

In this article, we look at how modern browsers handle video bitrates when recording using the MediaStream Recording API, and its MediaRecorder object.

We've done real-world testing across Chrome, Firefox, and Safari on macOS, Safari on iOS and Chrome on Android at different resolutions, and we share our findings on browser defaults, codecs, and browser behavior.

Bitrate vs. quality: a visual comparison

To make the impact of bitrate concrete, here are two recordings made in Safari iOS - using a simple MediaRecorder implementation - with the back camera at 4K resolution, but with different bitrates. The difference in frame rate and picture quality is immediately visible. The size of the recordings is also a big differentiator. For example, with the same length, the recording at 2 Mbps is 3,5 MB, while the one at 15 Mbps is 18,4 MB.

0:00
/0:10

two 4k recordings: one at 2Mbps one at 15Mbps

Bitrate control

The MediaStream Recording API lets you set a videoBitsPerSecond value when starting a recording. According to the spec, this value is "a hint for the encoder" and "might be surpassed, not achieved, or only be achieved over a long period of time." Below, we'll look at which browsers and operating systems respect it and which don't.

The default bitrate in each browser

If you don't pass a videoBitsPerSecond value to the MediaRecorder, each browser will use its own hardcoded default value:

To test these defaults, we measured the video bitrate while recording videos using:

We recorded at different resolutions, at 30 FPS. Audio was excluded through the getUserMedia call. Here are the results:

Chrome (WebM, H.264) on macOS

Resolution Default bitrate Actual bitrate
480p 2.5 Mbps 2.70 Mbps
1080p 2.5 Mbps 2.70 Mbps
2160p 2.5 Mbps 2.70 Mbps

Chrome goes 8% over its 2.5 Mbps default regardless of resolution.

Firefox (WebM, VP8) on macOS

Resolution Default bitrate Actual bitrate
480p 2.5 Mbps 2.50 Mbps
1080p 2.5 Mbps 2.50 Mbps
2160p 2.5 Mbps 2.50 Mbps

Firefox locks to exactly 2.5 Mbps across all resolutions.

Safari (MP4, H.264) on macOS

Resolution Default bitrate Actual bitrate
480p 10 Mbps 7.96 Mbps
1080p 10 Mbps 9.23 Mbps
2160p 10 Mbps 9.22 Mbps

Safari approaches its 10 Mbps default at 1080p and above.

Safari (MP4, H.264) on iOS

Resolution Default bitrate Actual bitrate
480p 10 Mbps 5.65 Mbps
1080p 10 Mbps 9.75 Mbps
2160p 10 Mbps 9.54 Mbps

iOS Safari follows the same pattern, but the bitrate is lower at 480p.

Chrome (MP4, H.264) on Android/Samsung Galaxy S21 FE

Resolution Default bitrate Actual bitrate
480p 2.5 Mbps 2.54 Mbps
1080p 2.5 Mbps 9.52 Mbps
2160p 2.5 Mbps 2.93 Mbps

At 480 the default is respected, 1080p recording quadruples the bandwidth used and, somehow, at 4k, we're using a lot less.

With the exception of our Chrome/Android test, the defaults are enforced. Each browser consistently produces video bitrates close to its defined default. As a result, the bitrate doesn't scale with resolution. A 4K recording in Chrome on macOS, without specifying a custom bitrate, will hit the 2.5 Mbps ceiling (default bitrate on Chrome) just like a 480p recording.

What happens when you explicitly set videoBitsPerSecond

Current versions of Chrome, Firefox, and Safari all support the optional videoBitsPerSecond property.

Chrome (WebM, H.264) on macOS

ResolutionRequestedActual
480p1.50 Mbps1.65 Mbps
1080p7.00 Mbps7.22 Mbps
2160p14.00 Mbps14.31 Mbps

Firefox (WebM, VP8) on macOS

ResolutionRequestedActual
480p1.50 Mbps1.45 Mbps
1080p7.00 Mbps6.66 Mbps
2160p14.00 Mbps14.08 Mbps

Safari (MP4, H.264) on macOS

ResolutionRequestedActual
480p1.50 Mbps1.34 Mbps
1080p7.00 Mbps6.17 Mbps
2160p14.00 Mbps13.05 Mbps

Safari (MP4, H.264) on iOS

ResolutionRequestedActual
480p1.50 Mbps1.57 Mbps
1080p7.00 Mbps6.75 Mbps
2160p14.00 Mbps12.24 Mbps

Chrome (MP4, H.264) on Android/Samsung Galaxy S21 FE

ResolutionRequestedActual
480p1.50 Mbps2.02 Mbps
1080p7.00 Mbps9.57 Mbps
2160p14.00 Mbps13.71 Mbps

The videoBitsPerSecond property is largely respected. Across the tested browsers and platforms, with the exception of several scenarios on Chrome on Android, the actual bitrate stays within roughly 10-15% of what was requested. The spec says videoBitsPerSecond is a hint, and indeed these browsers treat it as a target on macOS and iOS.

What bitrate should you actually use?

Setting a bitrate matters with higher resolutions. It directly affects file size and visual quality. A lower bitrate means smaller files but more compression artifacts, especially at higher resolutions.

For a practical reference point, YouTube's recommended upload bitrates are a reasonable starting point for what "good quality" looks like at each resolution. For 1080p, they suggest 8 Mbps for SDR content at 30 fps, and for 4K, it goes up to 35-45 Mbps for SDR at 30 fps.

Whether the default 2.5 Mbps is good enough depends on what you're recording and at what resolution. At 720p and above, videos recorded at the 2.5 Mbps default bitrate on Chrome and Firefox start showing visible compression artifacts, such as tearing and smearing in areas with motion or fine detail.

A note on codecs

Firefox only supports VP8 in the WebM container. Chrome records to WebM with H.264 by default. Safari records to MP4 with H.264 by default. In some cases, Chrome and Safari support better codecs (our MediaStream Recording API demo lists them all).

The bitrate needed to achieve a given level of picture quality decreases with more efficient codecs and increases with higher fps.

Given the many possible codecs and file types, if you need your recording to play cross-browser, you'll need to process them further. This article covers why MP4 files need to be processed further. Pipe handles this. It takes whatever MediaRecorder produces across browsers and transcodes everything to H.264 and AAC in an MP4 container, so you don't have to deal with that.

What these results show

  • Each browser has a hardcoded default bitrate: 2.5 Mbps for Chrome and Firefox, 10 Mbps for Safari.
  • These default values do not scale with resolution. A 4K recording gets the same bitrate as a 480p one unless you specify otherwise.
  • Setting videoBitsPerSecond works on macOS and iOS; browsers respect it within about 10–15%.
  • In many tests, Chrome on Android does not respect the bitrate.
  • Bitrate affects file size and quality significantly. Don't assume the default is good enough for all resolutions.
  • For consistent file and codec output across browsers, complete metadata including duration information and proper playback across delivery methods (fast start) you need to process the files further.
MediaRecorder Video Bitrates
Share this
IT TAKES 1 MINUTE
Sign up for a 14 Day Trial

With our 14 days (336 hours) trial you can add audio, video and screen + camera recording to your website today and explore Pipe for 2 weeks