givo / lib-kurento

A typescript library for simplifying the use of Kurento in Node.js
24 stars 5 forks source link

Recording HD videos: override max video bandwidth #6

Closed d9k closed 4 years ago

d9k commented 4 years ago

If I call setMaxVideoRecvBandwidth() in my code

  await webRtcEndpoint.init()

  // no effect!
  await webRtcEndpoint.endpoint.setMaxVideoRecvBandwidth(50000)

it doesn't take effect (poor quality of recorded videos).

I had to modify SdpEndpointWrapper.init() to run setMaxVideoRecvBandwidth() before processOffer()

    async init() {
        await super.init();

        // mod
        await this._endpoint.setMaxVideoRecvBandwidth(50000)

        // process sdp offer
        this._sdpAnswer = await this._endpoint.processOffer(this._sdpOffer);
        this.emit("SdpAnswerCreated", this._sdpAnswer);
    }

Maybe it's a good idea to make some event on EndpointWrapper.init() right after _endpoint creation to have time to manipulate it before processOffer() begins.

    async init() {
        this._endpoint = await this._pipeline.create(this._endpointName, this._createOptions);
        this.emit("EndpointCreated", event);

or, simpler, no automatic processOffer() on SdpEndpointWrapper.init() (extract it to separate method)

Using lib-kurento@0.0.7

givo commented 4 years ago

Hi,

Can you share some more details on your setup? which codec are you using? What kind of video are you sending to server (camera, screen sharing..)? Do you implement p2p, multicast?

Are you sure that calling setMaxVideoRecvBandwidth() before processOffer made the trick?

Only if you can prove me that this is the issue I'll add "before" and "after" init events or something similar.

givo commented 4 years ago

I'm closing this issue because there's no response