google / spatial-media

Specifications and tools for 360º video and spatial audio.
Other
1.8k stars 419 forks source link

How to use with ambisonic audio + head-locked stereo? (6 channel audio gives error) #249

Open Boscop opened 3 years ago

Boscop commented 3 years ago

I tried to use it with the --spatial-audio flag on my first-order ambisonic 360° video which also contains head-locked stereo, which YT supports!

But I get an error:

Error: Found 6 audio channel(s). Expected 4 channel(s) for periphonic ambisonics of order 1.

Error failed to insert spatial audio data
Saved file settings
        Track 0
                Spherical = true
                Stitched = true
                StitchingSoftware = Spherical Metadata Tool
                ProjectionType = equirectangular
        Track 1
terminating

How can I make it work? :)


Btw, ffprobe on my video file prints:

    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 385 kb/s (default)

Btw, I also tried converting my audio to opus instead of aac, but it doesn't work with ffmpeg:

> ffmpeg -i ambi_with_hl_stereo.wav -mapping_family 2 -c:a libopus -b:a 768k ambi.ogg
Guessed Channel Layout for Input Stream #0.0 : 5.1
[...]
[libopus @ 0000002171c43000] Unknown channel mapping family 2. Output channel layout may be invalid.

Why doesn't it recognize channel mapping family 2?


And when I encode the audio as PCM in MOV (the other option that YT allows), such that ffprobe shows:

    Stream #0:1: Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 5.1, s16, 4608 kb/s (default)

I get the same error with the spatialmedia injector:

Error: Found 6 audio channel(s). Expected 4 channel(s) for periphonic ambisonics of order 1.

Why doesn't it recognize that I want head-locked stereo when I have 6 channels?