[opus] libopus API question - 120ms encoding

Timothy B. Terriberry tterribe at xiph.org
Wed Oct 30 10:26:44 PDT 2013

Wang, Chris wrote:
> Thanks Jean-Marc and Benjamin for the answers.
> One follow-up question.  If I use a repacketizer as Jean-Marc suggested by combining two 60ms frames to form a 120ms frame, without extracting individual frames and using a new TOC, I would need to have a "de-packetizer" that does the exact opposite of repacketizer.  De-packetizer would need to separate this 120ms frame into two 60ms frames and feed them individually to the decoder.  In other words, the OPUS decoder can't decode an input that has two or more TOCs, right?


When you use the repacketizer, it internally removes the extra TOC 
sequence from every packet after the first, and combine things into one 
packet with a single TOC sequence. This is the reason it can't combine 
packets if they have different configurations (mode, audio bandwidth, 
channel count, or frame size).

The decoder will decode any legal packet, regardless of how many frames 
it has. You do not need to use the repacketizer to split them apart again.

More information about the opus mailing list