Search Unity

Video 360 Video with Embedded Ambisonic Audio

Discussion in 'Audio & Video' started by blee808, Dec 31, 2017.

  1. blee808

    blee808

    Joined:
    Apr 17, 2016
    Posts:
    7
    I am looking to play a 360 video with embedded 6 channel ambisonic audio using Unity 2017.3.

    I installed the "Oculus Spatializer Unity" and have experience with the "yellowball" example. I also have experience playing a video on the skybox. The problem is using embedded ambisonic audio from the video.

    Can ambisonic audio embedded in a video be used directly without exporting it to a separate file?
     
    IceSmoke likes this.
  2. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    I'm not sure tbh, but have you tried Google's Resonance spatializer too ?
     
  3. blee808

    blee808

    Joined:
    Apr 17, 2016
    Posts:
    7
    Thanks for the reply. There may be different ways of solving this problem using 3rd party assets, but I want to know if Unity directly supports such functionality.

    Can unity play 6 channel ambisonic audio embedded in a video?
     
  4. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    Well, that's the thing I don't know :)
    All ambisonic sources should be picked up by the decoder, if set up, in newer versions of Unity it's maybe even semiautomatic - if not there's setting the clip is of ambisonic type - so my best guess was to simply try out Google's Resonance plugin and play the video if Oculus Spatializer doesn't work,
    Sorry I don't have complete answer.

    Unity itself is shipped only with what you can see in AudioManager settings ( e.g. 2017.2 has only OculusSpatializer as ambisonic decoder : Google's Resonance has to be installed separately )
     
  5. blee808

    blee808

    Joined:
    Apr 17, 2016
    Posts:
    7
    Right on. Again, thank you for the response. I am going to check out Google Resonance as you suggested.
     
  6. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    hey there.

    I'm facing the same problem and it's hard to find useful information in the web / docs about this specific case. Many are talking about spatial audio, the plugins work well with imported audio, playback of 360 video works also without problems. But what's about a video with spatial audio - in @blee808 case 6 tracks, I try to playback a video with 4 tracks / ambisonic b-format as far as I know. The video works with spatial sound in GoPro Player and also on Youtube/Facebook.

    I'm currently testing in Unity 2017.4.2 and 2018.1
    OculusSpatializer and Google Resonance, currently I would not care which one to use.
    Target would be the Oculus Go / Gear.

    The video file is very large, so I am streaming either direct from a url or download to persistant data and then playback from there. This already works, but the audio playback is obviously stereo. In parallel, I playback an ambisonic test wav (imported with ambisonic checked in import settings) for comparison which sounds spatial.

    A general confusing Unity log bug in adb seem to be:
    Unable to find libAudioPluginOculusSpatializer

    But it seem to work anyway.

    Some questions which come into my mind:
    1. Is there currently a way in Unity to playback video with spatial audio?
    2. Do you have some thoughts / experiences to share?

    Even if I would separate video and audio and download both, the problem would consists how to flag the audioclip as ambisonic.

    In the last days I had to learn that it's much more complex than I thought: technical correct usage of spatial audio in video is very rare and hard to debug, if you're not creator of the files and developer of the player at the same time. The problems I'm talking about: strange audio flipping in certain directions, many channel order possibilities, pseudo spatial from stereo, checkboxes and players which not tell you, how they interpret your footage and many new words for people, coming from the visual side of life: ambisonics, ambix, fuma, ACN, SN3D, FOA, HOA, TBE, Opus, FacebookAudio360... sometimes I think about just muting the video. But it's a concert ;)

    In Unity Manual 2018.1 they write:
    Initially, it is only expected that ambisonic decoder plugins will support 1st order ambisonic sources and binaural stereo output.
    There is nothing in the current framework that is specific to any of the different ambisonic formats available. If the clip’s format matches the ambisonic decoder plugin’s expected format, then everything should just work. Our current plan, though, is that Unity’s preferred ambisonic format will be B-format, with ACN component ordering, and SN3D normalization.

    Another option would be using the AVPro video plugin from renderheads - they support 360 facebook audio in 1.8.5 -> but special use of mkv + opus codec. I never used it and have no example file. Did someone tested it already?

    I hope we can bring this thread back to life and can exchange some experiences about using 360 videos with spatial audio in unity.

    And respect if you read everything :)
     
    Last edited: May 14, 2018
    KT_unity likes this.
  7. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    It seems, I'm the only one who wants a 360 video with spatial sound in Unity. Strange o_O

    For now I asume, that the AVPro Video plugin is currently the only solution. I downloaded the facebookaudio tools, extracted a 4 channel wav from my mp4 and then reassembled them with the fb encoder, because in the avpro doc they write:
    The video files must be using a MKV file container and audio must be using the
    Opus codec encoded with Facebook Audio 360.

    Currently this seem to be an experimental feature (FB360 Matroska Spatial Workstation 8 Channel):
    fb_encoder1.jpg

    These "8 channel" note irritates me (seem to be mandatory, but why? in general the encoder has too few settings) and after encoding and trying to playback in unity I noticed, that this seem to make my 4 channel first order ambix track to something else... choosing 4 channel ambix order in unity causes an error from the plugin. I choose now TBE_8 or TBE 8_2 - they seem to work, but all in all in feels too much like trial and error, not correct settings.
    unity_settings.jpg

    My current result:
    - the audio seem to be spatial in editor playback on Windows and also on the Oculus Go aka Android
    - on windows the audio is async, about 2sec (obviously caused by a video freeze at the beginning)
    - on android the audio is sync (same file), but stutters a lot

    I'm using avpro plugin 1.8.5. / Unity 2017.4.2

    @AndrewRH - can maybe you clarify some of the workflow you experienced by testing this feature of your plugin? Do you have plans for more spatial audio support? For example no restriction to the mkv container and opus codec?

    Why not using another encoder program like MeGUI? I would have way more options, could keep the 4 channel ambix and still use mkv as container and opus... I'll give it a try and if interesting will share my result.
     
  8. aracid

    aracid

    Joined:
    Sep 1, 2013
    Posts:
    8
    @noemis you're not alone, Been going through a lot of this myself.
    However I'm at the stage where I can write out 360 video from Reaper with ambisonic sound all working fine through the oculus video player.

    I've been struggling to get it to work within unity.

    I'll submit any findings to this if I come across anything and thanks for the AVPro hint.

    Cheers
     
    noemis likes this.
  9. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hey @noenis

    Yes I'm not sure why the FB Audio 360 encoding tools have so few options and still mark it as experimental...I will see if I can find out.

    Could you send over (to the unity support email at www.renderheads.com/contact/) some examples of your videos so I can see the audio delay and stuttering? We can hopefully find a solution to these, or ask the FB guys to weigh in.

    I would love to add more spatial audio support. We're just a small team though so we have limited resources. The MKV and Opus codec restriction came from FB as this is what they support in their Audio 360 SDK. I'm not sure why they went for MKV...but Opus is a great codec with its only downfall being that is isn't so well supported still (eg on iOS). What sort of other spatial audio systems/features would you like us to support?

    Thanks,
     
    noemis likes this.
  10. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    Thank you @aracid and @AndrewRH for your replies!

    Here are some new facts I wan't to share:
    1. the mkv produced by the facebook encoder has 10 channels which require the avpro settings TBE_8_2 as Channel Mode, which sounds correct (in my ears) - this is definitely a disadvantage, because not every spatial audio track would use so many channels
    2. If you choose the wrong channel mode, the video doesn't play, plays too fast or sound is extrem glitchy
    3. you CAN encode with MeGUI. It has much more settings and supports mkv output and opus codec. I could keep the original 4 channel and so have to switch the channel order to AMBIX_4. Which is great. But I also noticed, that at the beginning it is also async, audio starts early, the video 2sek later, so the video runs faster... but after a while it's sync. But the audio still stutters sometimes. My video was baseline with few ref frames and very low settings, so this should not be the problem.
    4. just as a test I tried the original mp4 with 4 channels and hoped, it would just work. But no! The audio was played back in stereo.
    During testing I also had the problem, that I can't believe my ears 100%. I am testing with a concert and it has a large sound, we're standing next to a piano which starts playing at a certain point in time. But as long as my eyes are open, I know where the piano stands, and let me think that the sound comes from a certain direction, even if wasn't spatial audio.

    This is how I currently test, if spatial audio works:
    - start app and close eyes
    - rotate the y-axis of the camera root to a random value between 0 - 360
    - try to locate the piano (eyes still closed)
    - open eyes and see if I'm right

    This simple analog test (done multiple times) works for me, because I was always correct. As I tried the mp4 I had no idea where I am.

    I talked with the producer of the concert and next week hopefully we create something like the good old color bars for 360 video+audio. A 30sec clip with clear sounds/voice from all directions to create a better testscenario.

    @AndrewRH: you maybe could find out with better connections to unity and understanding of the possibilities of unity + sdk why unity can playback ambix wav files of first order via standard audiosource just by checking a import checkbox... but why shouldn't it be possible for example your plugin to tell the connected audiosource, that the incoming stream is ambisonic?

    And I'll send two files to your support, one encoded with fb360 (10 channels) and MeGUI (4 Channel Ambix).
     

    Attached Files:

    Last edited: May 15, 2018
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks, I will respond in detail in a bit - but for now I just wanted to share that in the Facebook Audio 360 Renderer SDK there is a MKV test file which has a human voice which comes from the different directions - very useful for testing.
     
    noemis likes this.
  12. hiephovu

    hiephovu

    Joined:
    May 15, 2018
    Posts:
    2
    Hi there,
    I am interested in this topic as well, as I am building a 360 video launcher and was wondering if the new 360 video player supports ambisonic sound with the metadata baked in? Right now I use Youtube for spatial audio delivery and use FFmpeg to encode the audio and video together.
     
  13. ad12345

    ad12345

    Joined:
    Oct 24, 2015
    Posts:
    6
    Hey @aracid @AndrewRH @noemis - has there been any update on this?
    Any working solution?

    I too am trying to work with videos with embedded spatial audio in unity and prefer not to separate the audio as have multiple videos. I've been testing with Facebook Audio 360, Reaper, FFmpeg, AVPro, Resonance, etc. So I had spatial sound working in a video outside of unity but once in unity it switches just to stereo. I'm still testing the trial version of AVPro and glad to read it plays spatial audio in unity. Will try the closed eye test! It does blow out my file size though.

    Hope someone's made a breakthrough on videos with embedded spatial audio in unity :)
     
  14. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    hey @ad12345,

    As far as I know and tested as good as I could (4th June 2018), this is the situation (feel free to correct me you vr skilled world):

    Short version: No! You can't use Unity to play 360 video with embedded ambisonic audio.

    Long version:
    1. Unity 2017.4.2 / 2018.1 can't play a 360 video with an embedded ambisonic track. Which is a pity, because it has the skills under the hood.
    2. playing a video with unityplayer / avpro and then sync the audio with extra audioplayer (best solution seems facebook audio360 sdk) is kind of working, but not very sync - the audio sdk supports an external clock for syncing, but this causes glitches (for more infos to the sdk see here)
    3. Using audio as master track and then sync video to it seem also not possible
    4. avPro can playback an mkv with embedded opus audio, but it also has playback problems: on windows for example I wait for the ReadyToPlay event, then Play()... audio starts immediately, video about 3 seconds later - using low latency helped - but on android I have glitchy sound again. And yes: I'm using OES Shader and "use fast OES path" option is enabled)
     
    ad12345 and AndrewRH like this.
  15. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I'm still trying to find time to look into this in more detail. Hopefully soon :) Thanks for keeping this thread alive.
     
    ad12345 and noemis like this.
  16. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    This would be great @AndrewRH ! Maybe your plugin could solve the syncing problematic somehow:

    One of the last things I tried was again trying to sync the video to the audio, because having a constant audio is much more important in my case... and that video loading and seeking take time is understandable. So I think best way to sync two video files is take an audio track as time reference and use it as a clock for video playback... there is a build in possibility in unity, but not well documented and when using it, I always get into trouble. Basic setup is:

    Code (CSharp):
    1.  
    2. //in Start
    3. unityPlayer.timeReference = VideoTimeReference.ExternalTime;
    4.  
    5. //in Update
    6. audiotime = audioPlayer.spat.getElapsedTimeInMs ();
    7. videotime = unityPlayer.time*1000;
    8. unityPlayer.externalReferenceTime = audiotime / 1000 ;
    I start the audio after the video prepared event, so I get a very small delay from maybe 10ms... I could live with it.

    But when using this external clock thing I recognize some problems.

    1. When I seek the audio to a certain point, the video follows. But now we are about 100ms async, and this is already very noticeable. And it never syncs back, which is annoying, because I my opinion, the code tells the videoplayer the correct time, but it ignores it.

    2. Another case would be, that I offset the video. During runtime I add an offset (from 0 to something)
    Code (CSharp):
    1. unityPlayer.externalReferenceTime = (audiotime+offset) / 1000 ;
    Let's say my audio is 1min long. My video 2min (1st min = 1st angle, 2nd min = 2nd angle). So starting video and audio at the beginning is no problem. After 15sek I add an offset of 60sek to see the video at angle 2 (=75sek), but audio continues. Setting the first offset works in most cases (again it's getting more async), but setting the offset back to 0 for example is not working. Most time, the video just starts at the beginning or does other complete async stupid things...

    3. Instead of seeking in the video I just tried to load another video and after preparation seek to current audioposition, but it takes time and we are again async. And yes, seeking time is always different. So in this case a working constrain to an external clock after playback would be also the solution.

    So again, I just can leave some thoughts... no solutions.
     
  17. jerrytian

    jerrytian

    Joined:
    Feb 27, 2016
    Posts:
    5
    Luckily came across this thread before the end of a whole day of searching around, even more lucky to find @AndrewRH from AVPro already here. We use AVPro heavily on 360 video related projects, which does the job quite well.

    Trying to figure out how to play mp4 video files with embedded ambisonic sound tracks, just the same with @noemis 's case.

    The video file is rendered within Adobe Premiere CC 2018, using VR ambisonic video preset, which itself is following the guide from Google.

    In short, it is a video with FOA(First Order Ambisonic, i.e, AMBIX_4 format, defined in Facebook Audio360 SDK) audio embedded. And as @noemis mentioned, GoPro VR Player can play it with correct spatial sound effect.

    Checked manual's from latest version of AVPro, though mentioned FB Audio360 audio support, it is requiring the sound track separated with video, ready locally, and with specific container for it(I think this limitation is imposed by FB Audio360 SDK?).

    Some possible leads.

    After checking document from latest FB Audio360SDK(May 16, 2018), it is shipping a unity package, and an Android ExoPlayer plugin implementation. Since ExoPlayer is also behind AVPro on Android platform(which is our main deployment target), my wild guess is that AVPro would have a better chance to support the feature if directly operate on the ExoPlayer part.

    And for streaming, this part is interesting, and again, may need the above Audio360SDK ExoPlayer integration working first.


    Preparing Assets For Streaming

    Multichannel Ambisonic and head-locked audio can be streamed via DASH using a webm container. audio360/Scripts/fbaudio-dash.pycan be used to generate a DASH manifest and compatible audio and video assets from a FB360 Matroska file created with the FB360 Encoder application. Requirements: 1. FFmpeg (either in the system PATH or use -f to specify a custom path) 2. Shaka Packager (Use -p to specify the path) 3. Ensure the FB360 Matroska is using a video codec that is compatible with MP4 (e.g H264) Usage: python fbdaudio-dash.py -i INPUT_MKV -p PATH_TO_SHAKA_PACKAGER -o OUTPUT_MANIFEST python fbdaudio-dash.py -i input.mkv -p /path/to/shaka/packager -o manifest.mpd
    or run the following for help and a list of all commands: python fbdaudio-dash.py -h
    The packaging command will create a DASH manifest, a webm container for audio and a mp4 container for video. If necessary, you can always swap the video out for another version/codec you might want to use.



    A sample 360 video file with FOA track enabled will be posted later. Hope it helps.
     
    Last edited: Jun 5, 2018
  18. jerrytian

    jerrytian

    Joined:
    Feb 27, 2016
    Posts:
    5
  19. jerrytian

    jerrytian

    Joined:
    Feb 27, 2016
    Posts:
    5
    Another finding today.

    Even this is from Google, using GvrAudioSoundfield from "Resonance Audio" to play ambisonic audio is working, using pre-bundled AMBIX_4 track, on Oculus platform(Rift and Gear).

    That is, AVPro will play the video only, and a separate audio track is played at the same time.

    Problems left:

    • AV sync, though in some case here, this may not be a issue(short looping video and sound).
    • Runtime control of the sound. i.e, using downloaded audio tracks, switching tracks when needed.
    Still, ideally, player itself can handle the track in DASH/HLS or MP4 container could be the most convenient way to go.
     
    Last edited: Jun 6, 2018
  20. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    Thanks for the tipp. I'm not used to the GvrAudioSoundfield, but I use the Audio360 SDK from facebook. There is unity package inside. I use the SpatDecoderFile Script to load ambix wav files from streaming asset or persistant storage at runtime on android... works very well and sound is spatial (also when the spatializer plugin and ambisonic decoder are not set in the audiomanage in unity). Also the option to focus the sound is very interesting.

    To solve the AV problematic I currently work on the following: I average the delay (= videotime - audiotime) over some frames... then I adjust the playbackrate of the videoplayer (unity and avpro support it). For example if my video is 100ms behind after seeking, I set the playbackrate to 1.05 (instead of 1) and switch back to 1 when video and audio are sync again. It seem to work, but there are still some things to do. But until now, these are my best results. It works better with avPro, because the seeking in the video is faster and more stable... the unity videoplayer freezes sometimes, when I go back in time.

    So far from me.
     
    ad12345 likes this.
  21. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    We're also busy upgrading AVPro Video to use the new version of FB Audio 360 (v1.5.0) which was released a few weeks ago. To do this we also have to upgrade to the latest ExoPlayer. I'm not sure if these new versions will improve anything but let's see....
     
  22. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    at least the point
    Fixed: (Unity) Fix for buffering/crackling on Android
    (in Release Logs for 1.5.0) sounds interesting, because this is why I started using external playback... but playing audio external has also some advantages, like fading the sound from one spatial track to another...
     
  23. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hey all, I've got a beta version of AVPro Video with the new FB Audio 360 1.5.0 (from 1.4.0) and ExoPlayer 2.8.1 (from 2.6.0). If you're interested to test it, please email me at the unity support email here: http://www.renderheads.com/contact

    @noemis yes cross-fading tracks - sounds like a really good reason to go with that approach!
     
    ad12345 likes this.
  24. Jon-at-Kaio

    Jon-at-Kaio

    Joined:
    Oct 17, 2007
    Posts:
    185
    It would be really nice if somebody from Unity3d Chimed in on this subject, Am working on 360 video players where I want to support ambisonic audio which is embedded in the video, but would rather avoid the added workflow complications of using additional encoding tools & plugins.
     
    TRAKVR, ad12345 and noemis like this.
  25. TRAKVR

    TRAKVR

    Joined:
    Apr 11, 2018
    Posts:
    2
    Any updates on this topic? Currently trying to get embedded ambisonic from a 3D 360 video (.mp4) running through the skybox to work on an Oculus Go :)
     
  26. Sub_Black

    Sub_Black

    Joined:
    Nov 1, 2017
    Posts:
    3
    Hello, there is a Unity package and some plugins from a company called Hear360. Take a look at their site, and when you check out the skate demo make sure you are listening in headphones.

    https://hear360.io/
    http://104.131.148.71/SkatePark/2D/
     
  27. TRAKVR

    TRAKVR

    Joined:
    Apr 11, 2018
    Posts:
    2
    Thanks for your recommendation, but there's no proper reference to any plugins or packages, only a brief one on their homepage that redirects to a secure page requiring a password to access. Hear360 don't even show up in the Unity asset store. I'd be curious to know how Hear360 provides a solution to our problem...?
     
  28. VArtisans

    VArtisans

    Joined:
    May 6, 2017
    Posts:
    2
    It looks like I'm having similar problems to those mentioned earlier in the thread. I'm using the Facebook encoder to combine our video with ambisonic audio and a stereo headlocked track. Using AVPro, I was able to get ambisonic working on PC, but the video is lagging behind the audio by about two seconds. On the Oculus Go, I can't even get AVPro to play the MKV. I just get the "Decode Failed" error no matter what I try.

    Has anyone figured out any solutions for this recently?
     
  29. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    That's strange (about Android Oculus Go)... Did you set the MediaPlayer on Android to ExoPlayer and the audio to Facebook Audio 360? We've tested successfully with Oculus Go using version 1.8.9 of AVPro Video.

    We also have an update to AVPro Video coming out this week (any day now) which includes the latest version of Facebook Audio 360 (1.6.0) which may help things. We're also adding a new sample scene + video to the package that shows a 360 stereo video with spatial audio playing back using FB Audio 360.

    Thanks,
     
  30. VArtisans

    VArtisans

    Joined:
    May 6, 2017
    Posts:
    2
    Thank you! Switching to ExoPlayer was the step I was missing. It's working now on the Go. Looking forward to the new update!
     
  31. zonbin

    zonbin

    Joined:
    Aug 26, 2018
    Posts:
    1
    thank you so much
     
  32. unity_Pr7LJH3Hn4g_Lw

    unity_Pr7LJH3Hn4g_Lw

    Joined:
    Jan 9, 2018
    Posts:
    1
    Hello friends!! Is there a way to declare the audio on a 360 video file as ambisonics just like an audio file? Could somone kindly write a script like so??

    Thanks so much!!
     
    dariony likes this.
  33. jacknorrisuk

    jacknorrisuk

    Joined:
    Jun 17, 2014
    Posts:
    38
    Hi everyone,
    Thanks for all the detailed technical notes on spatial audio for 360 playback, it's been super useful and we've got our FB360 MKVs running beautifully...

    ...The only trouble we have now is that some of our 360 filmmakers have not complied with our request to convert their films into this format.
    I do not have the information to hand for safely converting their spatial audio MP4s into MKVs, and would simply like to support the MP4s as good ol' headlocked stereo audio. But, worryingly, the MP4s play with no audio at all. Can someone tell me what embedded audio codec/format I need in an MP4 for it to playback on an Android device - even just stereo?
    Alternatively - is there a chance this could be a bug with playing MP4s with a different audio mode in the same app runtime as spatial 360 MKVs?

    Any help greatly appreciated :)
     
  34. Dysonco

    Dysonco

    Joined:
    Sep 28, 2018
    Posts:
    2
    Hi All,

    Any updates here? I've been reading this with interest and the conclusion I'm currently getting is that the AVPro product is the current only way to have Spatial Audio on a 360 video in unity? Is that correct?

    I've been trying to get Facebook 360 video (with spatial sound) working naively in unity but I'm reading so many contradictory methods, suggestions (and issues) I'm not really make any sense of it. It doesn't help that I'm not a developer I'm a film maker just trying to prove work flow and proof of concept. So although I've roughly worked out playback of the 360 video in unity, some of the concepts mentioned above go a little above my head!

    Any advice as to the best route much appreciated!

    Thanks,

    Dysonco
     
    ad12345 likes this.
  35. contempt

    contempt

    Joined:
    Jul 31, 2012
    Posts:
    88
    Thanks to @AndrewRH and this thread I've figured out how to encode an ambisonic 360 video to playback on Oculus Go.
    This just worked for me:
    1) Strip audio out of source file if video has audio embedded by exporting out of encoding app like AME (Adobe Media Encoder) as video only and encode to H.265 or H.264 (only tested with H.264 so far)
    2) Take mp4 file and open in VLC then choose Convert/Save and select profile "Video - H.264 + MP3 (MP4)" and click on tool icon next to pull down menu and choose MKV under Encapsulation tab.
    3) Save out no audio MKV.
    4) Open FB360 Encoder.
    5) Add in no audio MKV video file
    6) Add in ambisonic (4 channel) Wav file and set to B-format 1st order ambiX
    7) Choose FB360 Matroska (experimental) from Select Format
    8) Setup video layout
    9) Hit Encode
     
  36. adrianstaude

    adrianstaude

    Joined:
    Jan 8, 2019
    Posts:
    4

    Hi @jacknorrisuk ,
    if you haven't figured this out yet: I found a bug in the current Version of AVPro that makes switching from stereo to spatial audio within one mediaplayer impossible. If you first play mkv(spatial) and then mp4, no sound will be played for mp4. If you first play mp4 and then mkv, mkv will not play at all. I've informed Renderheads via Mail and included a sample project. Only way right now is to destroy old mediaplayer, instantiate a new one, set it up and load next video.
     
    Rulfer likes this.
  37. adrianstaude

    adrianstaude

    Joined:
    Jan 8, 2019
    Posts:
    4
    I am also trying to get mp4 with embedded spatial audio working on Oculus Go (android). The interesting thing is: It works for Oculus Videoplayer and Samsung VR Player. How do they do it??
     
  38. TheSwanCollective

    TheSwanCollective

    Joined:
    May 6, 2016
    Posts:
    26
    Dear all,

    I'm currently looking for the same solutions!

    My situation: 3D 360 Unity skybox video player working perfectly on the Oculus Go, but the 1st order ambisonic audio (exported from Premiere Pro CC) doesn't get spatialized right.
    As @adrianstaude also just said, Samsung VR Player is able to do it, so there should be a (simple??) solution to all of this, without weird reencoding into MKV/FB360 stuff.

    Or does it already work out of the box with AVPro, @AndrewRH?

    ANY help is appreciated and the person who will point me to a working solution will receive 50$ via PayPal from me :)

    Please!

    @contempt @Dysonco @jacknorrisuk @zonbin @VArtisans @TRAKVR @Sub_Black @noemis @jerrytian @blee808
     
  39. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm, if you have 1st order ambisonic video you should be able to use the FB360 conversion tool to convert it into a MKV video with Opus audio (this is currently a requirement of our plugin when using Android). Then it should work pretty easily - you only have to change the audio channel layout to "AMBIX_4" in the MediaPlayer component, under Platform Specific > Android section. There is a free trial version of the plugin if you wish to test it with your video:
    http://renderheads.com/product/avpro-video/
    and the FB360 audio tools can be downloaded here (if you download the VST package it comes with the conversion application):
    https://facebook360.fb.com/spatial-workstation/

    Cheers,
     
  40. binoman

    binoman

    Joined:
    Sep 29, 2016
    Posts:
    13
  41. hunter_sk

    hunter_sk

    Joined:
    May 3, 2016
    Posts:
    6
    Hi!
    we had similar problem playing embeded audio to simulate 3D sound. Our working solution:

    - using video file with 2 mono audio streams (separated left and right channels)
    - set audio output mode for video player as Audio source
    - video player should have 2 outputs (standard stereo audio stream has 1 audio source output, 2 mono streams has 2 outputs)
    - create 2 audio sources on left and right side from listener position
    - set Spatial Blend to 3D on them
    - set 3D settings - min Distance to value when listener is in the distance sphere
    - link outputs from video player to these new audio sources

    Hope it helps! We had hard times to figure it out :)
     
  42. TheSwanCollective

    TheSwanCollective

    Joined:
    May 6, 2016
    Posts:
    26
    Dear @hunter_sk, thanks for the update and the private heads-up :)
    I'll try this then!
     
  43. ImmersiumStudioDeveloper

    ImmersiumStudioDeveloper

    Joined:
    Feb 3, 2018
    Posts:
    27
    Hi, I'm working in app that uses video 360º and audio ambix. The video has recorded with a GoPro Fusion (4 channels first order). There's is any option to play the videos with Unity Video Player with ambisonic audio working? I have tested a lot of code, scripts, assets but anything work...

    @hunter_sk the methodology that you describes works with Fusion video files?
     
  44. hunter_sk

    hunter_sk

    Joined:
    May 3, 2016
    Posts:
    6
    It depends how precise the audio output has to be in which direction. One solution is to convert B-format audio to some n-channel "speaker pattern" and create video with n audio streams. It may be just 2 streams and sounds "OK".

    Edit: simplest, low precision audio position - render the files from Fusion Studio with Stereo audio selected and use 2 channel setup in Unity.
     
    Last edited: Feb 5, 2020
  45. ImmersiumStudioDeveloper

    ImmersiumStudioDeveloper

    Joined:
    Feb 3, 2018
    Posts:
    27
    It's possible to convert 4 channels audio ambix of the Fusion video to 6 mono audio to use in unity scene? (up, down, left, right, front, rear speakers)?
     
  46. hunter_sk

    hunter_sk

    Joined:
    May 3, 2016
    Posts:
    6
    If 2 channels work, I assume that 6 should be similar. Maybe you have to adjust volumes down on them.
     
  47. ImmersiumStudioDeveloper

    ImmersiumStudioDeveloper

    Joined:
    Feb 3, 2018
    Posts:
    27
    @hunter_sk how do you build a video file with 2 mono audio streams? I rendering videos in Premiere with h264 codec and when I put to Unity video player only shows 1 audio source.
     
  48. hunter_sk

    hunter_sk

    Joined:
    May 3, 2016
    Posts:
    6
    • Create mono audio files (2 for stereo inputs, L, R)
    • Use free command line utility FFmpeg (https://ffmpeg.org) to merge streams with command:
    Code (JavaScript):
    1. ffmpeg -i <video_file> -i <audio_file_L> -i <audio_file_R> -map 0:0 -map 1:0 -map 2:0 -vcodec copy <output_video_file>
     
  49. ImmersiumStudioDeveloper

    ImmersiumStudioDeveloper

    Joined:
    Feb 3, 2018
    Posts:
    27
    Thank you! I will test it.
     
  50. LarsAK

    LarsAK

    Joined:
    Apr 4, 2018
    Posts:
    1
    Unity to play 360 video with embedded ambisonic audio --> Any update with this?
    I got my 360 videos in a separate folder on my Oculus Quest 2 with embedded ambisonic audio. When playing them through Unity skybox video player, it does recognize that there are 4 channels on the video, but only plays in stereo. This happens whether I adjust the 'Default Speaker Mode' audio settings under project settings to 'Quad' or surround sound or something entirely else - still Stereo.

    Do you really have to play Ambisonic audio and 360 video separately if you are to use Unitys video player?