Martin Backhaus
2020-Aug-07 02:10 UTC
[opus] Ambisonics with Head Locked Stereo to Opus Channel Mapping Family 2 for WebVR Chrome App and YouTube
Hello, I am trying to encode an Opus file with Ambisonics including Head-Locked (non-diegetic) Stereo sound for a Virtual Reality 360° video. YouTube describes the spatial audio requirements here: https://support.google.com/youtube/answer/6395969 It's the last list item 5.> 5. Supported First Order Ambisonics (FOA) with Head-Locked Stereo format: > W, Y, Z, X, L, R as a 6-channel audio track in your uploaded file, sample rate: 48 kHz > PCM encoded audio in a MOV container: > Sample rate: 48 kHz > OPUS encoded audio in an MP4 container: > Min. bitrate 768 kbps > Channel mapping family: 2I am trying to encode 6 Channels as Opus to an .opus and .webm file. Until now, YouTube and Chrome Browser cannot playback the results correctly. VLC is not playing anything. Using this MOV container and PCM works. I am using the following ffmpeg command: ffmpeg -i ambix_6ch_withHLS.wav -c:a libopus -b:a 768k -mapping_family 2 -y ambix.opus The opusenc.exe binary does not mention a command line argument for channel mapping. In this mailing list archive, Emily Bowman mentioned 19 December 2019, that Ambisonics is an API-only feature. Is this still correct? Here's the specification: https://tools.ietf.org/html/rfc8486 Chapter 3.1 and 3.3 are important, also concerning Head-locked stereo. Here's the output of opusinfo (converted from WAV using ffmpeg): Processing file "ambix_6ch.opus"... New logical stream (#1, serial: 20487e76): type opus Encoded with Lavf58.45.100 User comments section follows... encoder=Lavc58.91.100 libopus encoded_by=Adobe Premiere Pro 2020.0 (Windo time_reference=11163152 date=2020-08-07 Opus stream 1: Pre-skip: 312 Playback gain: 0 dB Channels: 6 Original sample rate: 48000 Hz Streams: 5, Coupled: 1 Channel Mapping Family: 2 Map: [2, 3, 4, 5, 0, 1] Packet duration: 20.0ms (max), 20.0ms (avg), 20.0ms (min) Page duration: 700.0ms (max), 609.2ms (avg), 100.0ms (min) Total data length: 8535952 bytes (overhead: 0.466%) Playback length: 1m:25.885s Average bitrate: 795.1 kbit/s, w/o overhead: 791.4 kbit/s Logical stream 1 ended So the goal is to have this 4-channel Ambisonics track ("Ambix" ACN SN3D format, first order) with 2-channel "head locked" Stereo (total of 6 channels) encoded to opus, (and muxed to mp4), so YouTube understands it and - more important - a WebVR Chrome App. Any encoding guide, further Opus + Ambisonics documentation would help, especially as YouTube mentions it as a supported format. Am I missing something? Thanks and best regards, Martin -- Martin Backhaus Mail: contact at martinbackhaus.com