Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio Quality - Opus Codec #208

Closed
marc5000 opened this issue Jun 18, 2014 · 14 comments
Closed

Audio Quality - Opus Codec #208

marc5000 opened this issue Jun 18, 2014 · 14 comments

Comments

@marc5000
Copy link

Hi,

I'd like to know if there is any granular control over the audio quality using PeerJS? I'd like to send audio in stereo at 128kb with the Opus codec to a connecting client. Is this possible to enter those parameters with PeerJS? Or any other way to achieve this?

Regards

@michelle
Copy link
Member

Hi! I think there's a discussion about this here: #177

I've not yet determined the best way to go about allowing adequate, useful codec configuration within PeerJS, but am actively thinking about it. What sort of interface would be most useful for you? How much would you need to customize this?

@marc5000
Copy link
Author

Michelle,

Thanks for the reply! It would be good to have granular and explicit control over the codec and bitrate (quality) of the audio connection. If you like, an override variable that sticks the bitrate at a fixed position. The samplerate can remain at 48k, that's fine.

I'd like to work on a high quality audio link between studios, so ideally we can choose increments up to 320kbps (if possible?), although for the Opus codec that may be quite high considering it's quality already. Anything higher than the default...

I feel the current default Opus connection quality is too low, and audio is cut off at round 15kHz, and not completely wide band (20Hz - 20kHz).

So if we can have access to these switches:

codec: <-- (choose the codecs available with WebRTC)
bitrate: <-- (override the bitrate of Opus, so a user can put in 128 to achieve a 128kbps connection)
stereo: <-- (enable/disable stereo channel? - don't know if this available yet in WebRTC)

I think those simple switches will open up a lot of possibilities, especially for those developers who want to make broadcast applications (like me!)

Let me know if this is possible. I've seen people achieve this, but not much info really.

@marc5000
Copy link
Author

marc5000 commented Jul 3, 2014

Hi Michelle,

Did you have any further thought regarding this? Do you have any beta builds that we can play around with yet =)

Cheers

@khejing
Copy link

khejing commented Nov 6, 2014

I think just codec set is enough. Webrtc js app code in https://bitbucket.org/webrtc/codelab and other examples, do have preferOpus() or preferISAC(). PeerJS just need provide the same thing. It impact the Android audio quality very much. I am writing the code and after test I will send a push. I just want to see how you think about this? Thanks!

@marc5000
Copy link
Author

marc5000 commented Nov 6, 2014

Hi Will,

Good to hear from you. Having a bandwidth control would be good as well, to
increase the quality of the codec. Can you include that as well?

Thanks

On Thu, Nov 6, 2014 at 2:23 PM, Will Lee notifications@github.com wrote:

I think just codec set is enough. Webrtc js app code in
https://bitbucket.org/webrtc/codelab and other examples, do have
preferOpus() or preferISAC(). PeerJS just need provide the same thing. It
impact the Android audio quality very much. I am writing the code and after
test I will send a push. I just want to see how you think about this?
Thanks!


Reply to this email directly or view it on GitHub
#208 (comment).

Marc Bakos

_UK Land: +44 1932 80 80 20UK Mob: +44 7 909 514 505South Africa: +27 11
568 0973USA: +_1 323 395 2897

www.marcbakos.com
marc.bakos@gmail.com

@khejing
Copy link

khejing commented Nov 6, 2014

this is ok, but different codec have.different bandwidth range. I will do the rangr check.

--- 原始邮件 ---

发件人: "Marc5000" notifications@github.com
已发: 2014年11月6日 下午10:37
收件人: "peers/peerjs" peerjs@noreply.github.com
抄送: "Will Lee" khejing@hotmail.com
主题: Re: [peerjs] Audio Quality - Opus Codec (#208)

Hi Will,

Good to hear from you. Having a bandwidth control would be good as well, to
increase the quality of the codec. Can you include that as well?

Thanks

On Thu, Nov 6, 2014 at 2:23 PM, Will Lee notifications@github.com wrote:

I think just codec set is enough. Webrtc js app code in
https://bitbucket.org/webrtc/codelab and other examples, do have
preferOpus() or preferISAC(). PeerJS just need provide the same thing. It
impact the Android audio quality very much. I am writing the code and after
test I will send a push. I just want to see how you think about this?
Thanks!


Reply to this email directly or view it on GitHub
#208 (comment).

Marc Bakos

_UK Land: +44 1932 80 80 20UK Mob: +44 7 909 514 505South Africa: +27 11
568 0973USA: +_1 323 395 2897

www.marcbakos.com
marc.bakos@gmail.com


Reply to this email directly or view it on GitHub:
#208 (comment)

@marc5000
Copy link
Author

marc5000 commented Nov 6, 2014

Okay, or even if you just have the bandwidth control for Opus, as that is probably going to be the most popular case where users will need to change the bandwidth, manually.

Thanks
Marc

On 6 Nov 2014, at 14:54, Will Lee notifications@github.com wrote:

this is ok, but different codec have.different bandwidth range. I will do the rangr check.

--- 原始邮件 ---

发件人: "Marc5000" notifications@github.com
已发: 2014年11月6日 下午10:37
收件人: "peers/peerjs" peerjs@noreply.github.com
抄送: "Will Lee" khejing@hotmail.com
主题: Re: [peerjs] Audio Quality - Opus Codec (#208)

Hi Will,

Good to hear from you. Having a bandwidth control would be good as well, to
increase the quality of the codec. Can you include that as well?

Thanks

On Thu, Nov 6, 2014 at 2:23 PM, Will Lee notifications@github.com wrote:

I think just codec set is enough. Webrtc js app code in
https://bitbucket.org/webrtc/codelab and other examples, do have
preferOpus() or preferISAC(). PeerJS just need provide the same thing. It
impact the Android audio quality very much. I am writing the code and after
test I will send a push. I just want to see how you think about this?
Thanks!


Reply to this email directly or view it on GitHub
#208 (comment).

Marc Bakos

_UK Land: +44 1932 80 80 20UK Mob: +44 7 909 514 505South Africa: +27 11
568 0973USA: +_1 323 395 2897

www.marcbakos.com
marc.bakos@gmail.com


Reply to this email directly or view it on GitHub:
#208 (comment)

Reply to this email directly or view it on GitHub.

@khejing
Copy link

khejing commented Nov 6, 2014

OK, I got it.

--- 原始邮件 ---

发件人: "Marc5000" notifications@github.com
已发: 2014年11月6日 下午11:04
收件人: "peers/peerjs" peerjs@noreply.github.com
抄送: "Will Lee" khejing@hotmail.com
主题: Re: [peerjs] Audio Quality - Opus Codec (#208)

Okay, or even if you just have the bandwidth control for Opus, as that is probably going to be the most popular case where users will need to change the bandwidth, manually.

Thanks
Marc

On 6 Nov 2014, at 14:54, Will Lee notifications@github.com wrote:

this is ok, but different codec have.different bandwidth range. I will do the rangr check.

--- 原始邮件 ---

发件人: "Marc5000" notifications@github.com
已发: 2014年11月6日 下午10:37
收件人: "peers/peerjs" peerjs@noreply.github.com
抄送: "Will Lee" khejing@hotmail.com
主题: Re: [peerjs] Audio Quality - Opus Codec (#208)

Hi Will,

Good to hear from you. Having a bandwidth control would be good as well, to
increase the quality of the codec. Can you include that as well?

Thanks

On Thu, Nov 6, 2014 at 2:23 PM, Will Lee notifications@github.com wrote:

I think just codec set is enough. Webrtc js app code in
https://bitbucket.org/webrtc/codelab and other examples, do have
preferOpus() or preferISAC(). PeerJS just need provide the same thing. It
impact the Android audio quality very much. I am writing the code and after
test I will send a push. I just want to see how you think about this?
Thanks!


Reply to this email directly or view it on GitHub
#208 (comment).

Marc Bakos

_UK Land: +44 1932 80 80 20UK Mob: +44 7 909 514 505South Africa: +27 11
568 0973USA: +_1 323 395 2897

www.marcbakos.com
marc.bakos@gmail.com


Reply to this email directly or view it on GitHub:
#208 (comment)

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub:
#208 (comment)

@michelle
Copy link
Member

michelle commented Nov 7, 2014

Wow,thanks! This would be great :).

Michelle

On Thu, Nov 6, 2014 at 7:13 AM, Will Lee notifications@github.com wrote:

OK, I got it.

--- 原始邮件 ---

发件人: "Marc5000" notifications@github.com
已发: 2014年11月6日 下午11:04
收件人: "peers/peerjs" peerjs@noreply.github.com
抄送: "Will Lee" khejing@hotmail.com
主题: Re: [peerjs] Audio Quality - Opus Codec (#208)

Okay, or even if you just have the bandwidth control for Opus, as that is
probably going to be the most popular case where users will need to change
the bandwidth, manually.

Thanks
Marc

On 6 Nov 2014, at 14:54, Will Lee notifications@github.com wrote:

this is ok, but different codec have.different bandwidth range. I will
do the rangr check.

--- 原始邮件 ---

发件人: "Marc5000" notifications@github.com
已发: 2014年11月6日 下午10:37
收件人: "peers/peerjs" peerjs@noreply.github.com
抄送: "Will Lee" khejing@hotmail.com
主题: Re: [peerjs] Audio Quality - Opus Codec (#208)

Hi Will,

Good to hear from you. Having a bandwidth control would be good as well,
to
increase the quality of the codec. Can you include that as well?

Thanks

On Thu, Nov 6, 2014 at 2:23 PM, Will Lee notifications@github.com
wrote:

I think just codec set is enough. Webrtc js app code in
https://bitbucket.org/webrtc/codelab and other examples, do have
preferOpus() or preferISAC(). PeerJS just need provide the same thing.
It
impact the Android audio quality very much. I am writing the code and
after
test I will send a push. I just want to see how you think about this?
Thanks!


Reply to this email directly or view it on GitHub
#208 (comment).

Marc Bakos

_UK Land: +44 1932 80 80 20UK Mob: +44 7 909 514 505South Africa: +27 11
568 0973USA: +_1 323 395 2897

www.marcbakos.com
marc.bakos@gmail.com


Reply to this email directly or view it on GitHub:
#208 (comment)

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub:
#208 (comment)


Reply to this email directly or view it on GitHub
#208 (comment).

@mediabrokers
Copy link

What is the status of this? This is one of the most important features and it takes month to figure out how to config codec and bandwidth? I guess i have to change to another library as can't wait months to control the bandwidth LOL amazing.. Yeah peerjs is really cool i love it but when you totally blow off the ability to control bandwidth I don't understand this at all.

@talhaobject90
Copy link

Hi, any have a fix on this? . Any way to set codec (Opus )for peerjs audio calls.
Is there any other library easy as peer js to be used for now?

@afrokick
Copy link
Member

afrokick commented Apr 4, 2019

We added sdpTransform parameter to Connection's options, try use it.

peer.call('id', {sdpTransform:(sdp)=>{ ...transforming...  return newSdp;}});

@Lovinity
Copy link

@afrokick sdpTransform does not seem to work properly. For example, when I transform the sdp in peer.call to add a "b=AS:128" line to specify a 128kbps bitrate, the application executing peer.call sets that locally, but the peer.answer client does not have that line locally. In effect, bitrate never actually changes since only one of the two clients had their SDP transformed.

This seems to also happen for a=fmtp parameters; sdptransform transforms the sdp for the client executing peer.call, but it is not negotiated with the client receiving the call.

@afrokick
Copy link
Member

Thanks @Lovinity Could you please check fix in #524 ?

@afrokick afrokick reopened this Apr 15, 2019
@afrokick afrokick removed the request label Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants