Arya Basiri
Arya Basiri

Reputation: 177

how to specify max frame rate, width and height, and quality of webrtc videos?

I want to decrease the quality of videos in WebRTC using SimpleWebRTC, How can I do that?

I did this but doesn't work properly:

var webrtc = new SimpleWebRTC({
    localVideoEl: 'localVideo',
    remoteVideosEl: 'remoteVideo',
    autoRequestMedia: true,
    media: {
        video: someFunction(), // which returns true after some IFs
        audio: someFunction()  // same as previous one
    },
});

It works, but when I add:

video: {
        mandatory: {
            maxFrameRate: 15, maxWidth: 320, maxHeight: 240
        }
    }

it doesn't work, because hasn't returned true yet(I think).

Could you help me how I can fix it? or even suggest me a new way to decrease the quality in order to use less bandwith.

Thanks

Upvotes: 0

Views: 3826

Answers (1)

xdumaine
xdumaine

Reputation: 10339

You're using the old constraints style. The new syntax looks like this:

video: {
    frameRate: {
        max: 15
    },
    width: {
        max: 320
    },
    height: {
        max: 240
    }
}

source

Upvotes: 3

Related Questions