sonosaurus / sonobus

Source code for SonoBus, a real-time network audio streaming collaboration tool.
https://sonobus.net
GNU General Public License v3.0
1.54k stars 110 forks source link

add support for OPUS at bitrate 512000 ? #19

Open chaseology opened 3 years ago

chaseology commented 3 years ago
essej commented 3 years ago

Well, I guess I could add 512k, but remember that in the UI you are actually specifying it per channel, so a stereo send set at 256k/ch is a 512k total stream. I've also found that quality-wise, it is diminishing returns up there. You might as well choose 16bit PCM at that point and not incur the latency penalty of Opus.

Right now the Opus frame size is chosen based on the audio buffer size you are using... I use the lowest frame-size I can >= the audio buffer size, with the exceptions of the extremely low bitrate options which sound like garbage unless I increase the frame size. I could bury a manual frame-size selection somewhere, but I don't want to confuse people by presenting yet another option. I assume you are interested in it to get the maximum opus quality by using a big frame size without also using a big audio buffer size, and you don't care about latency?

chaseology commented 3 years ago

Thank you for your reply... I was mistaken about the 256 bitrate being split to 128 per channel...so the 256 per channel is fine...no need for 512 per channel as you state...

RE: frame-size
when operating Mumble's OPUS frame-size option, we found that we achieved less latency as the frame-size is lowered...first, we adjusted the Mumble OPUS quality setting to fit our needs, and then tried to adjust the frame-size lower and lower until we started noticing too many packet drops, glitches and delays... which is why i was curious as to how OPUS codec frame-size might operate in SonoBus

when using Gstreamer's OPUS codec pipelines, we also noticed a similar lowering of the latency, while keeping the audio quality of OPUS audio encoding the same, then trying to lower the OPUS FRAME size one step at a time until the packet performance dropped and audio crackles, pops & clicks etc started to rise up and create audio stream annoyances

essej commented 3 years ago

Because latency was my primary consideration, I am always using the smallest Opus frame size that makes sense, and I also use the additional low latency flags in it as well.