muaz-khan / RecordRTC

RecordRTC is WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.
https://www.webrtc-experiment.com/RecordRTC/
MIT License
6.52k stars 1.75k forks source link

What bitsPerSecond are we supposed to used for 720p, 1080p and 4k video? #717

Open trackedsupport opened 3 years ago

trackedsupport commented 3 years ago

Is there some formula like FPS X resolution to determine the bitsPerSecond? I can't understand what values I'm supposed to be using.

I did find values listed here.... https://restream.io/blog/what-is-a-good-upload-speed-for-streaming/ But even that im not sure.

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

I thought about doing something like this? But am I using too large of values or too small?

var bits_per_second = 5000000;

if (current_camera_height > 2100){
  bits_per_second = 16777216
}

if (current_camera_height > 1000){
  bits_per_second = 7500000
}