plutoless / eEducation

e-education solutions(Agora Reference Design)
184 stars 124 forks source link

How can I set the aggregate resolution of my video below 1280 × 720? #178

Closed suretrust closed 4 years ago

suretrust commented 4 years ago

I am currently trying to reduce the data used by video stream subscribers. How can I set the aggregate resolution of my video below 1280 × 720?

I have tried using stream.setVideoProfile('120p_1') and/or the code below but none of them seems to be working. Perhaps, I'm defining them in the wrong places? I am currently defining it in utils/agora-web-client.ts just before stream.init(.... Can anyone point me in the right direction please?

stream.setVideoEncoderConfiguration({
      // The video resolution.
      resolution: {
        width: 640,
        height: 480,
      },
      // The video frame rate (fps). We recommend setting it as 15. Do not set it to a value greater than 30.
      frameRate: {
        min: 15,
        max: 30,
      },
      // The video bitrate (Kbps). Refer to the video profile table below to set this parameter.
      bitrate: {
        min: 1000,
        max: 5000,
      },
    })
srs888001 commented 4 years ago

You can modify it in file agora-rtc-client.ts. And in the createlocalstream method, after creating the localstream.

suretrust commented 4 years ago

Thanks a lot, @srs888001. 🖖 That worked!