[opus] Encoder state management - 'chunked' Opus?

David Holroyd
Mon, 22 Jul 2013 14:11:14 -0000

Hi,

I'm playing around using Opus in a 'chunked' streaming context,
where
chunks of media are served in separate HTTP responses.

I am trying to hunt down the source of some clicks-and-pops during
playback, and while it is very likely that these glitches are due to the
low quality of my code, I wanted to ask if the admonition in the API
docs[1] that "encoder state *must* *not* be re-initialized for each
frame" might be flagging anything more than simple inefficiency?

My code does not recreate encoder state per-frame, but it does create
new state at the start of each 'chunk' (where a chunk is 1 second of
consecutive Opus frames, right now).  Is this an unsupported use of the
codec (and therefore a potential source of my issue), or should this
have little impact on the output other than reduced efficiency?


ta,
dave


[1]
http://www.opus-codec.org/docs/html_api-1.0.2/group__opus__encoder.html#details


--