Hi, I don't understand how works the multi stream api in opus. I need to send two mono streams over network with RTP. I think I'm right when I create an OpusMsDecoder with opus_multistream_decoder_create (48000, 2, 2 ,0 ,mapping, NULL) where mapping is: unsigned char mapping[2] = {0,1} isn't it ? Next, i need to encode data which I get from jack (float) so I use opus_multistream_encode_float(enc, data, 480 , encodedData, MAX_DATA) Then I send it using RTP. My question is how can I make the opposite in the client. I created my decoder with m_decoder = opus_multistream_decoder_create (48000, 2, 2 ,0,mapping,NULL) and unsigned char mapping[2] = {0,1}; Currently, I can read my RTP packet from network, and get data from it. I need now to decode opus data to something readable for jack. I do it like that : opus_multistream_decode_float(m_decoder, data, len, decodedBuffer, BUFLEN, 0); But how can I know the start of the two packets ? Thanks for your help, Audric Ackermann -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20121218/190d3981/attachment.htm
Hi Audric, First thing I'd like to point out is that the current RTP draft does not support transmitting more than one stream. Unless the two streams are truly unrelated, I recommend sending as a stereo stream using the standard (non multi-stream) API. Otherwise, you will not be compatible with any other application, in which case, I strongly recommend *not* using "opus" as the SDP codec name. On 12/18/2012 10:21 AM, Audric Ackermann wrote:> I think I'm right when I create an OpusMsDecoder with > > opus_multistream_decoder_create (48000, 2, 2 ,0 ,mapping, NULL) > > where mapping is: unsigned char mapping[2] = {0,1} isn't it ? > > Next, i need to encode data which I get from jack (float) so I use > opus_multistream_encode_float(enc, data, 480 , encodedData, MAX_DATA)Looks correct.> My question is how can I make the opposite in the client. > I created my decoder with > m_decoder = opus_multistream_decoder_create (48000, 2, 2 > ,0,mapping,NULL) and > unsigned char mapping[2] = {0,1}; > > Currently, I can read my RTP packet from network, and get data from it. > I need now to decode opus data to something readable for jack. I do it > like that : > opus_multistream_decode_float(m_decoder, data, len, decodedBuffer, > BUFLEN, 0);Also looks correct.> But how can I know the start of the two packets ?I don't understand your question. Jean-Marc
On Tue, Dec 18, 2012 at 10:21 AM, Audric Ackermann <audric.bilb at gmail.com> wrote:> Currently, I can read my RTP packet from network, and get data from it. IMultistream is not used with RTP as defined today. The multistream support requires a mechanism to communicate the mapping, see the Ogg/Opus draft for an example of his this is actually used. What you appear to be describing is just stereo? however. You don't use multistream fo stereo, you can just use a single stereo stream. Using multistream for stereo will make you incompatible with everything RTP based.