Hi Andrew, I think you'd have to decode each packet independently, then sum the results, making sure that packets (from different sources) all have the same number of samples. Marc Le 2022-03-24 ? 10 h 14, Andrew Sonzogni a ?crit?:> Hello, > > Yes, I mean mix multiple streams. > > Best regards, > Andrew Sonzogni > > -----Message d'origine----- > De?: Ulrich Windl<Ulrich.Windl at rz.uni-regensburg.de> > Envoy??: jeudi 24 mars 2022 15:00 > ??:andrew at safehear.fr;opus at xiph.org > Objet?: Antw: [EXT] [opus] Opus merging streams > >>>> Andrew Sonzogni<andrew at safehear.fr> schrieb am 24.03.2022 um 14:46 >>>> in > Nachricht<592e07eaa0e866e10543cf887948874d at mail.gmail.com>: >> Hello ! >> >> >> >> I have a question. I'm trying to use Opus on an embedded device which >> communicate with several other devices with the same software. >> >> I wanted to know if it's possible to merge Opus packets from different >> sources and then decode this merged packet through a normal opus_decode. > "merge" means "concatenate"? Or "mix"? > >> >> >> I receive in real time 3 different streams of 40ms opus packets. As it >> would be consuming too much CPU if I decode each packets and then sum >> them together, I would like to decode them together. > "sum" sounds like "mix", right? > >> >> >> Best regards, >> >> Andrew Sonzogni > _______________________________________________ > opus mailing list > opus at xiph.org > http://lists.xiph.org/mailman/listinfo/opus-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/opus/attachments/20220324/12f478e9/attachment.htm>
Hi Marc, Thanks for the quick reply. Then it?s not possible to mix those packets before decoding them ? Because summing after Opus would mean 3-4 decode every 40ms (frame size) and 3-4 queue of 1280o msg? Best regards, Andrew *De :* opus <opus-bounces at xiph.org> *De la part de* Marc Lavall?e *Envoy? :* jeudi 24 mars 2022 15:23 *? :* opus at xiph.org *Objet :* Re: [opus] Antw: [EXT] Opus merging streams Hi Andrew, I think you'd have to decode each packet independently, then sum the results, making sure that packets (from different sources) all have the same number of samples. Marc Le 2022-03-24 ? 10 h 14, Andrew Sonzogni a ?crit : Hello, Yes, I mean mix multiple streams. Best regards, Andrew Sonzogni -----Message d'origine----- De : Ulrich Windl <Ulrich.Windl at rz.uni-regensburg.de> <Ulrich.Windl at rz.uni-regensburg.de> Envoy? : jeudi 24 mars 2022 15:00 ? : andrew at safehear.fr; opus at xiph.org Objet : Antw: [EXT] [opus] Opus merging streams Andrew Sonzogni <andrew at safehear.fr> <andrew at safehear.fr> schrieb am 24.03.2022 um 14:46 in Nachricht <592e07eaa0e866e10543cf887948874d at mail.gmail.com> <592e07eaa0e866e10543cf887948874d at mail.gmail.com>: Hello ! I have a question. I'm trying to use Opus on an embedded device which communicate with several other devices with the same software. I wanted to know if it's possible to merge Opus packets from different sources and then decode this merged packet through a normal opus_decode. "merge" means "concatenate"? Or "mix"? I receive in real time 3 different streams of 40ms opus packets. As it would be consuming too much CPU if I decode each packets and then sum them together, I would like to decode them together. "sum" sounds like "mix", right? Best regards, Andrew Sonzogni _______________________________________________ opus mailing list opus at xiph.org http://lists.xiph.org/mailman/listinfo/opus -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/opus/attachments/20220324/69ad9b1d/attachment-0001.htm>
>>> Marc Lavall?e <marc at hacklava.net> schrieb am 24.03.2022 um 15:22 inNachricht <e4fcab1b-5498-417c-16da-9faa04d1d62e at hacklava.net>:> Hi Andrew, > > I think you'd have to decode each packet independently, then sum the > results, making sure that packets (from different sources) all have the > same number of samples.With modern multi-core CPUs you could decode in parallel at least. BTW: Are there any implementations that use multiple CPUs to encode different blocks of the same stream in parallel, or isn't it worth the effort (e.g. delay-wise)? Regards, Ulrich> > Marc > > Le 2022-03-24 ? 10 h 14, Andrew Sonzogni a ?crit : >> Hello, >> >> Yes, I mean mix multiple streams. >> >> Best regards, >> Andrew Sonzogni >> >> -----Message d'origine----- >> De : Ulrich Windl<Ulrich.Windl at rz.uni-regensburg.de> >> Envoy? : jeudi 24 mars 2022 15:00 >> ? :andrew at safehear.fr;opus at xiph.org >> Objet : Antw: [EXT] [opus] Opus merging streams >> >>>>> Andrew Sonzogni<andrew at safehear.fr> schrieb am 24.03.2022 um 14:46 >>>>> in >> Nachricht<592e07eaa0e866e10543cf887948874d at mail.gmail.com>: >>> Hello ! >>> >>> >>> >>> I have a question. I'm trying to use Opus on an embedded device which >>> communicate with several other devices with the same software. >>> >>> I wanted to know if it's possible to merge Opus packets from different >>> sources and then decode this merged packet through a normal opus_decode. >> "merge" means "concatenate"? Or "mix"? >> >>> >>> >>> I receive in real time 3 different streams of 40ms opus packets. As it >>> would be consuming too much CPU if I decode each packets and then sum >>> them together, I would like to decode them together. >> "sum" sounds like "mix", right? >> >>> >>> >>> Best regards, >>> >>> Andrew Sonzogni >> _______________________________________________ >> opus mailing list >> opus at xiph.org >> http://lists.xiph.org/mailman/listinfo/opus
On 2022-03-24, Andrew Sonzogni wrote:> Then it?s not possible to mix those packets before decoding them ?*Theoretically* you can mix without decoding to *some* degree. But the algorithm to do so would be...truly nasty. So just don't go there. You need to decode, mix, and recode. BTW, in many cases, you'd want to hold the separate incoming streams as separate already, and just pass them on. E.g. in conferencing applications, you'd typically not want to mix everything together, because 1) the mixer would prove a single point of failure, 2) business oriented conferencing is often an application where what people say is legally encumbered or might prove so later on, including the mixer, and 3) you typically don't want more than one person to take the stage anyhow, because absent body language and other close interaction, it'd just be an auditory mess. -- Sampo Syreeni, aka decoy - decoy at iki.fi, http://decoy.iki.fi/front +358-40-3751464, 025E D175 ABE5 027C 9494 EEB0 E090 8BA9 0509 85C2