HydrogenAudio

Lossy Audio Compression => Opus => Topic started by: kvk on 2020-10-06 20:55:25

Title: Audio artifacts at higher frequencies when live streaming with Opus
Post by: kvk on 2020-10-06 20:55:25
I've seen several folks post about audible artifacts at higher frequencies with encoding with Opus. (One suggestion was to use a low-pass filter around 15,000).

I'm working on live streaming concerts from my studio to my website, using a WebRTC company in British Columbia. Video encoder is VP8, audio is Opus. Works fine, except for the upper registers of the guitar - these sound distorted, almost like they are underwater. I've heard the same thing on another provider (OpenTok) using WebRTC and the Opus encoder. It's a bit nasty.

I'm unsure whether this can be addressed by implementing something in the WebRTC code (EQ or low-pass filter) or perhaps in the Opus encoder itself. I wanted to see what anyone might suggest for addressing this.

Thanks so much!!
Title: Re: Audio artifacts at higher frequencies when live streaming with Opus
Post by: Kamedo2 on 2020-10-07 03:20:45
I'm guessing that something other than the Opus encoder is at fault.
What bitrate are you using? Will it significantly improve if the rate is set to higher bitrate, say, 160kbps?
Title: Re: Audio artifacts at higher frequencies when live streaming with Opus
Post by: LithosZA on 2020-10-07 05:54:26
I think it might be a combination of the browser's audio processing filters and the negotiated audio bitrate.
Check out this stackoverflow thread: https://stackoverflow.com/questions/33649283/how-to-set-up-sdp-for-high-quality-opus-audio

Quote
Main reason for bad quality is the browser's audio processing. You need to pass audio constraints to the GetUserMedia object:

{ 'channelCount':{'exact': 2}, 'echoCancellation':false, 'autoGainControl':false, 'noiseSuppression':false }


Title: Re: Audio artifacts at higher frequencies when live streaming with Opus
Post by: LithosZA on 2020-10-07 13:00:07
Some extra links that might be helpful:
https://medium.com/@trystonperry/why-is-getdisplaymedias-audio-quality-so-bad-b49ba9cfaa83
https://stackoverflow.com/questions/46063374/is-it-really-possible-for-webrtc-to-stream-high-quality-audio-without-noise

Title: Re: Audio artifacts at higher frequencies when live streaming with Opus
Post by: kvk on 2020-10-07 16:27:47
Thanks so much for the info!! I keep attempting to set the bitrate to anywhere between 160 - 256 but examining the SDP output in the log shows it being reset to 96. So setting it higher might address it, but the echo/noise cancellation also seems relevant.

I'm getting a bit out of my depth trying to write SDP data or an SDP parser and knowing where to place it in the architecture (or whether I even can, in terms of access), but that might well be the issue - one method of pushing the stream out to the WebRTC server returns an SDP error.

I'll get to work on this - thank you!