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
}