datso / react-native-pjsip

A PJSIP module for React Native.
http://datso.github.io/react-native-pjsip
GNU General Public License v3.0
273 stars 232 forks source link

OPUS codec bitrate and channel #107

Open shaydvir opened 6 years ago

shaydvir commented 6 years ago

I'm trying to understand how do i pick the bitrate and the channel for the opus codec. when i look into settings.codecs, i'm getting the following result: G722/16000/1 G7221/16000/1 G7221/32000/1 GSM/8000/1 PCMA/8000/1 PCMU/8000/1 iLBC/8000/1 opus/48000/2 speex/8000/1 speex/16000/1 speex/32000/1

But i can't understand how do i compile opus with 16bps and channel 1. i tried to look into pjsip and opus libraries and i'm very confused. i could only come up with the following define:

PJMEDIA_CODEC_OPUS_DEFAULT_BIT_RATE

but i don't really understand where to put it and how to use it.

and ideas? thank you very much

joshelson commented 6 years ago

Per section 7 of the IETF spec, the SDP is always constructed with opus/48000/2.

Section 7.1 details the offer/answer considerations here, which will allow you to set optional parameters to constrain the bitrate. Those would need to be followed there as well, but per spec, the offer always will contain 48000/2.

shaydvir commented 6 years ago

So what does it actually mean? That i need to recompile the opus library or something like that?

shaydvir commented 6 years ago

@joshelson do i need to recompile the opus library?