What methods are commonly used to calculate the bitsPerSecond rate for media recording?

Is there a specific formula that combines frames per second and resolution to determine the bits per second for video encoding? I'm struggling to figure out the appropriate values to use for specifying the bits per second for 720p, 1080p, and 4k videos. I am considering whether the file type (webm or mp4) has an impact on this as well. I want to avoid unnecessarily large file sizes while ensuring smooth playback without glitches.

I came across some values listed in this resource... . However, I'm still unsure about how to properly apply them in my case.

My current setup involves using RecordRTC, a wrapper for MediaRecorder, which allows me to configure various settings including bits per second.

recorder = RecordRTC(camera, {
       recorderType: MediaStreamRecorder,
       mimeType: encoding_options,
       bitsPerSecond: bits_per_second,
       timeSlice: 15000,
       getNativeBlob: true
   });

Considering the above code snippet, I have been contemplating setting the bits per second value based on the camera resolution. However, I'm uncertain if the values I'm using are too high or too low.

var bits_per_second = 5000000;

if (current_camera_height > 2100){
  bits_per_second = 16777216
}

if (current_camera_height > 1000){
  bits_per_second = 7500000
}

Answer №1

To gain a better understanding of how video bitrate functions, I recommend checking out this informative article.

For optimal video quality on YouTube, it is advised to follow their recommended bitrates ( https://support.google.com/youtube/answer/1722171?hl=en#zippy=%2Cbitrate). Here are the suggested values:

bits_per_second = 40000000 for 4K video,
bits_per_second = 16000000 for 2K video,
bits_per_second = 8000000 for 1080p video,
bits_per_second = 5000000 for 720p video,
bits_per_second = 2500000 for 480p video,
bits_per_second = 1000000 for 360p video

Answer №2

Have you ever wondered about the bitrate required for uncompressed video?

BITRATE = SCREEN_SIZE_VERTICAL x SCREEN_SIZE_HORIZONTAL X FPS X PIXEL_COLOR_DEPTH
  • BITRATE: The bitrate is measured in bps (bits per second)
  • SCREEN_SIZE_VERTICAL: The vertical dimension of the screen in pixels
  • SCREEN_SIZE_HORIZONTAL: The horizontal size of the screen in pixels
  • FPS: frames per second
  • PIXEL_COLOR_DEPTH: The color depth of a single pixel.

You can associate resolutions like 720p, 1080p, and 4K with the following:

  • 720p: (1280 x 720)
  • 1080p: (1920 x 1080)
  • 4K: (3840 × 2160)

For instance, here are some details for 1080p, 24FPS, 3x8bit COLOR DEPTH video.

Uncompressed bitrate

Megapixels: 2.1 MP (2,073,600 pixels)
Aspect ratio: 1.78:1 (HD 16:9)
1 frame of RGB 3x8bit: 6.22MB (2.1 MP x 24 bits)
Interlaced: 24 fps x 6.22MB x 50% (interlacing) = 597.2Mbps = 74.65MB/s
Progressive: 24 fps x 6.22MB = 1.19Gbps = 149.3MB/s
Longer durations: 8.96GB/min = 537.48GB/hr
Estimated compressed bitrates
...

If you need help calculating bandwidth requirements for various video compression standards, try out this handy online tool.

Although not mentioned in the previous results, H.265 (or High Efficiency Video Coding - HEVC) offers significant bit rate reductions compared to H.264/MPEG-4 AVC HP according to the table below.

Video
coding       Average bit rate reduction
standard     compared with H.264/MPEG-4 AVC HP      
----------------------------------------------  
HEVC          480p  720p    1080p   2160p
----------------------------------------------
              52%    56%     62%     64%

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The counter variable does not function properly within a setInterval function

I have encountered an issue with my scroll-counter variable inside the setInterval function. It increments by 1 each time the setInterval function runs, which is supposed to happen 20 times before stopping. However, I noticed that the value of this variabl ...

Show only the lower left quadrant within the img tag during the prepend operation

I'm attempting to add an <img> tag in front of a <div> similar to this example on JSFiddle. However, I have a specific requirement to only display the bottom left quarter of the image instead of the entire one. HTML Markup <div id="my ...

The asynchronous callbacks or promises executing independently of protractor/webdriver's knowledge

Could a log like this actually exist? 07-<...>.js ... Stacktrace: [31m[31mError: Failed expectation[31m [31m at [object Object].<anonymous> (...06-....js)[31m[31m[22m[39m It seems that something is failing in file -06- while I am processin ...

How can you locate the position of identified text on a webpage to accurately place the mouse cursor there?

When browsing a webpage in my web browser (preferably Firefox), I have the ability to search for a specific text "abc" using ctrl+f. Once found, I need to move my mouse cursor to another relative position on the page and click. Unfortunately, the necessar ...

Ways to extract single JSON entities from a consolidated JSON structure

I am facing a challenge with parsing multiple JSON objects within a single large JSON object. Currently, the entire JSON object is being stored as one entity, but I need to parse and store them separately in MongoDB. Below is the code snippet I am using. ...

How to locate the data-id of the next element in a jQuery list

Is it possible to retrieve the data-id of the following list element when clicking a button while on the current active list item? <div class="nbrs"> <ul> <li id="item1" data-id="1" class="active ...

During server and browser builds, NextJs encounters a 404 error when trying to access files named _ssgManifest.js and _buildManifest.js. Additionally, the file named _

I recently deployed a NextJs application on a digitalocean droplet running Ubuntu 22.04. "next": "12.2.3", "react": "18.2.0", Encountering a 404 error for the following files: _ssgManifest.js, _buildManifest.js, an ...

Creating a multi-dimensional array in JavaScript with two different sizes

I'm struggling to find the best way to create a multi-dimensional array with varying sizes dynamically. Our user interface requires a pattern where there are rows of 4 items followed by rows of 3 items. This pattern should continue until all contents ...

At times, AngularJs template tags fail to evaluate

Can anyone explain why the templating tag [[ opt.option ]] is not always evaluating to a value in this code snippet? <span ng-repeat="opt in options"> <button ng-click="button = [[ opt.option ]]" ng-class="{ active : button == [[ opt.option ]] ...

Excessive form inputs extend beyond the modal when utilizing Bootstrap 3

Having an issue loading a modal with Angular and populating it with a template. The main problem I'm facing is that the inputs are extending beyond the boundaries of the modal - attached below is a screenshot illustrating the problem: Below is the c ...

Step by step guide on integrating ReactJS into your current node.js backend application

I am currently working on a basic node.js API Setup: | project-name | public | index.html | ... some static js/css | app.js | package.json app.js var express = require('express'), bodyParser = require('body-parser'), ...

How to Use Discord.js v13 to Make an Announcement in a Specific Channel

Looking for a Solution I am trying to create a command that allows an admin user to send a specific message to a designated channel. The Issue at Hand My current approach involves sending a response back to the user who triggered the command with the ent ...

The AngularJS templates' use of the ternary operator

Is there a way to implement a ternary operation in AngularJS templates? I am looking for a way to apply conditionals directly in HTML attributes such as classes and styles, without having to create a separate function in the controller. Any suggestions wo ...

Tips for inheriting external UI components in vue/nuxt?

Hello, I am currently navigating the world of Vue for the first time. My project utilizes Vue2, Nuxt, and Vuetify to bring it all together. One thing I am looking to do is create a base .vue component, as well as multiple components that inherit from this ...

What is the best way to retrieve the value from a text input field using React?

Currently, I am working on a registration form in React that includes validation. The required fields are Username, Email, Password, and Confirm Password. The form is functioning correctly in terms of validations, error handling, and redirecting to a new p ...

Errors occur when attempting to install plugins from npm

I am currently coding in Visual Studio 2017 using Ionic v2 to develop an app for beacon scanning. However, every time I try to install a plugin, I encounter errors from npm about the versions of node and npm being incompatible. Here are my current versions ...

Struggling to implement JQuery code in a Next.js application

I'm having trouble getting my tracking code to work in Next.js. <Script> window.dataLayer = window.dataLayer || []; function gtag(){ dataLayer.push(arguments) } gtag('js', new Date()) ...

Error encountered when attempting to resolve Angular UI Router provider

Having difficulty with integrating a resolve into a state using Angular UI router. Strangely, it works perfectly fine in another section of my code. I've organized my code into different component areas structured like this: /app /component-dashbo ...

What is the most effective method for implementing COPY/INSERT functionality with cascading effects in PostgreSQL?

Seeking advice on the most effective method to perform an "on cascade copy/insert" of linked elements within PostgreSQL. To better explain my scenario, I've crafted a straightforward example: Understanding the Database Structure Within the datab ...

Guide on setting a v-model within a v-for loop (using an example from Bootstrap Vue)

Currently, I am utilizing vue-bootstrap for creating input fields using a v-for directive. The objective is quite similar to the example provided in this link. However, I am encountering some difficulties in obtaining the data collected from these inputs i ...