[opus] opusenc for ambisonics?

Marc Lavallée marc at hacklava.net
Thu Dec 19 13:02:14 UTC 2019


Le 19-12-19 à 04 h 55, Emily Bowman a écrit :
> Unfortunately, ambisonics aren't exposed in opusenc yet, thus the
> trouble. They're an API-only feature, but it's a good time to discuss
> what such a command-line interface would look like, notably: how to
> specify multiple streams & stream order, select the mapping family,
> coupled channels, and how to specify the matrix (for family 3).
> Likewise, there's no multistream support at the moment, so two birds
> might be felled with one push. I have ideas, but I've never used
> ambisonics and really don't know what the use case would look like.

The simplest use case is to include all channels as uncoupled, as in the
original uncompressed file; this is what I did 5 years ago for a
personal project, by modifying opusenc to specify 255 as the mapping
family for a 3-channel file (a first order horizontal-only stream); the
opus decoder should obviously not consider an ambisonics stream as a
"surround" stream, and not try to decode it as an ambisonics stream
either (because ambisonics decoding is handled by the software using the
opus decoded stream).

What can be done easily now is specify a mapping family of 2 when
encoding with the latest ffmpeg and the opus library; ffmpeg does not
accept a mapping family of 3. But I don't understand the difference
between mapping family 2 and 255; what they mean to me is "uncoupled
channels". That simplest use case also implies that no ambisonics
decoding occurs in the opus decoder. So it could be that, as is, the
opus encoder is ready for this simple use case (like 5 years ago)...

What's also important is to preserve the phases of all channels; does
the opus encoder (and decoder) preserve phases of all 16 channels with
an uncoupled encoded stream?

Marc

>
> On Wed, Dec 18, 2019 at 10:00 AM Marc Lavallée <marc at hacklava.net
> <mailto:marc at hacklava.net>> wrote:
>
>     Le 19-12-18 à 12 h 29, Marc Lavallée a écrit :
>
>>     Hi Andrew,
>>
>>     I suspect that the configure option should be enable-ambisonics
>>     (instead of enable_ambisonics), but for each of opus, libopusenc,
>>     opusfile and opus-tools git repos (on master branch), when I try
>>     "./configure --enable-ambisonics", I get this error message:
>>
>>     configure: WARNING: unrecognized options: --enable-ambisonics
>>
>     I found that the --enable-ambisonics options is in opus 1.1.3, but
>     no longer in 1.3 versions; starting with version 1.3-rc2, support
>     for ambisonics is enabled by default, but I don't know how to use it.
>
>     I recompiled everything using opus 1.1.3 with the
>     --enable-ambisonics option, but opusenc don't offer an option for
>     mapping families.
>
>     It's all very confusing.
>
>>     Thanks for your help.
>>
>>     Marc
>>
>>     Le 19-12-18 à 11 h 52, Andrew Allen a écrit :
>>>     Hi Marc,
>>>
>>>     In order to use the ambisonics API, if you haven't already, you
>>>     will need to activate the enable_ambisonics build flag during
>>>     configuration.
>>>     Then, when encoding the file, make sure to manually select
>>>     mapping family 3 since opus does not auto-detect ambisonic files.
>>>
>>>     Let me know if you have any questions!
>>>
>>>     Cheers,
>>>     Andrew
>>>
>>>     On Tue, Dec 17, 2019 at 7:16 PM Marc Lavallée <marc at hacklava.net
>>>     <mailto:marc at hacklava.net>> wrote:
>>>
>>>         I compiled the latest (git master) of opus, libopusenc,
>>>         opusfile and
>>>         opus-tools:
>>>
>>>         $ opusenc --version
>>>         opusenc opus-tools 0.2-8-g4976421 (using libopus
>>>         1.3.1-4-gad8fe90d)
>>>
>>>         I tried to encode a 3rd order Ambisonics wav file with the
>>>         standard
>>>         Ambix (ACN-SN3D) format; opusinfo is reporting :
>>>
>>>         Streams: 16, Coupled: 0
>>>             Channel Mapping Family: 255 Map: [0, 1, 2, 3, 4, 5, 6,
>>>         7, 8, 9, 10,
>>>         11, 12, 13, 14, 15]
>>>
>>>         How to encode the file so that the Mapping Family is 3, as
>>>         suggested
>>>         here ? : https://people.xiph.org/~jm/opus/opus-1.3/
>>>
>>>         Marc
>>>
>>>
>>>         _______________________________________________
>>>         opus mailing list
>>>         opus at xiph.org <mailto:opus at xiph.org>
>>>         http://lists.xiph.org/mailman/listinfo/opus
>>>
>>
>>     _______________________________________________
>>     opus mailing list
>>     opus at xiph.org <mailto:opus at xiph.org>
>>     http://lists.xiph.org/mailman/listinfo/opus
>     _______________________________________________
>     opus mailing list
>     opus at xiph.org <mailto: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/20191219/45c3165f/attachment.html>


More information about the opus mailing list