MatroskaOpus: Difference between revisions

From XiphWiki
Jump to navigation Jump to search
(formatting)
(formatting, fallback question)
Line 3: Line 3:
Opus has few signaling requirements, so a simple mapping:
Opus has few signaling requirements, so a simple mapping:


CodecID is A_OPUS
- CodecID is A_OPUS
SampleFrequency is always 48000
- SampleFrequency is always 48000
Channels is 1 or 2 based on what the muxer knows about the input
- Channels is 1 or 2 based on what the muxer knows about the input
CodecPrivate is void.
- CodecPrivate is void.


However, this doesn't work for multistream. Supporting multistream requires signalling the number of Opus streams packed in each frame and the mapping from those to output channels through the container.
However, this doesn't work for multistream. Supporting multistream requires signalling the number of Opus streams packed in each frame and the mapping from those to output channels through the container.
Line 12: Line 12:
To support multistream, we place the complete 'OpusHead' header packet from OggOpus, as defined there, in the CodecPrivate element. This provides the number of streams and the channel mapping table, as well as related features like pre-skip and gain which improve the chances of lossless remuxing between the two encapsulations.
To support multistream, we place the complete 'OpusHead' header packet from OggOpus, as defined there, in the CodecPrivate element. This provides the number of streams and the channel mapping table, as well as related features like pre-skip and gain which improve the chances of lossless remuxing between the two encapsulations.


The Channel Matroska element's value should match that of the corresponding field of the OpusHead data; the Matroska SampleFrequency remains fixed at 48000.
- CodecID is A_OPUS
- SampleFrequecy is 48000
- Channels is number of output PCM channels
- CodecPrivate is the 'OpusHead' packet, identical to the Ogg mapping


The second 'OpusTags' header packet from OggOpus is not used in the Matroska encapsulation. Matroska has its own system for tag metadata, and this avoids duplicating it and the need for sub-framing to index multiple packets within the CodecPrivate element.
The second 'OpusTags' header packet from OggOpus is not used in the Matroska encapsulation. Matroska has its own system for tag metadata, and this avoids duplicating it and the need for sub-framing to index multiple packets within the CodecPrivate element.
If the CodecPrivate is empty, players should treat it as the simpler mapping, I guess. I don't know if we should say muxers MAY or SHOULD NOT produce such streams.

Revision as of 12:06, 16 December 2011

DRAFT encapsulation spec for the Opus codec in [Matroska].

Opus has few signaling requirements, so a simple mapping:

- CodecID is A_OPUS
- SampleFrequency is always 48000
- Channels is 1 or 2 based on what the muxer knows about the input
- CodecPrivate is void.

However, this doesn't work for multistream. Supporting multistream requires signalling the number of Opus streams packed in each frame and the mapping from those to output channels through the container.

To support multistream, we place the complete 'OpusHead' header packet from OggOpus, as defined there, in the CodecPrivate element. This provides the number of streams and the channel mapping table, as well as related features like pre-skip and gain which improve the chances of lossless remuxing between the two encapsulations.

- CodecID is A_OPUS
- SampleFrequecy is 48000
- Channels is number of output PCM channels
- CodecPrivate is the 'OpusHead' packet, identical to the Ogg mapping

The second 'OpusTags' header packet from OggOpus is not used in the Matroska encapsulation. Matroska has its own system for tag metadata, and this avoids duplicating it and the need for sub-framing to index multiple packets within the CodecPrivate element.

If the CodecPrivate is empty, players should treat it as the simpler mapping, I guess. I don't know if we should say muxers MAY or SHOULD NOT produce such streams.