Search Unity

Playing 360 videos as part of Unity app in GearVR

Discussion in 'AR/VR (XR) Discussion' started by Hughg, May 12, 2016.

  1. Hughg

    Hughg

    Joined:
    Jan 13, 2016
    Posts:
    16
    Hi all,

    I was trying to get a 360 video playing as part of an app basically for any scene where there isn't player interaction with any game objects but have been having issues getting it to display on the GearVR as part of a unity app (as opposed to the Oculus 360 video player).

    The technique I have tried was using 2 internally facing spheres with 2 cameras with culling masks. Ticking the 'Virtual Reality Supported' option in the player settings overrides the camera settings that I have in place. I'm not sure how to set up the right settings for the GearVR to work without ticking that box (I need the head tracking and input button from the headset).

    I've tried installing OVR Plugin and using the OVR utilities prefab cameras but when I run the app it just opens as a usual android app (i.e. no splitting of the screen). I've mainly worked with a DK2 before so this was the way I knew how to do it.

    I also tried using the sample scene from the Unity SDK examples folder but I get the error telling me that Oculus.Utilities requres Unity 4.6.

    Are there any guides out there on manually setting up a project to work with GearVR (or some way to modify the 'Virtual Reality Supported' checkbox function)?
     
  2. scottunity

    scottunity

    Joined:
    Feb 1, 2014
    Posts:
    72
    Turn on the checkbox but go to the camera. Duplicate the camera and set it to Target Eye - right, set other to right.
    Then create 2 layers, right and left.
    Assign one sphere to left layer and one to right.
    Set your culling mask to match along with UI layer
     
  3. Hughg

    Hughg

    Joined:
    Jan 13, 2016
    Posts:
    16
    Hi thanks for the reply,

    That's what I had originally tried but when I load it with the VR setting ticked I only get a single image (I tested putting a completely different image on each eye and only got one of them showing for both eyes)
     
  4. scottunity

    scottunity

    Joined:
    Feb 1, 2014
    Posts:
    72
    Did you setup the layering control? (including 3D object, sphere, whatever, assign to each layer side)
     
  5. Sephis

    Sephis

    Joined:
    Sep 4, 2012
    Posts:
    12
    For my first GearVR application I more or less followed those guides https://developer.oculus.com/documentation/game-engines/latest/concepts/unity-gsg/, http://www.samsung.com/us/samsungde...ames/exercise-1-creating-a-unity-project.html and I had no issue.

    Did you try with Oculus Mobile SDK? (https://developer.oculus.com/downloads/mobile/1.0.0.1/Oculus_Mobile_SDK/)

    If I remember well, I downloaded Oculus Utilities for Unity 5 and Oculus Mobile SDK, imported them to my project, then replaced the main camera by the OVRCameraRig prefab, checked the "Virtual Reality Supported" checkbox, added my Device ID to the Plugins/Android/assets folder and finally build my app.
     
    Last edited: May 16, 2016
  6. scottunity

    scottunity

    Joined:
    Feb 1, 2014
    Posts:
    72
    The issue is with VR video you have to be able to split the rendering into right and left eye specifically, especially for stereo support. A 3D environment is handled automatically by the standard vr camera.
     
  7. Hughg

    Hughg

    Joined:
    Jan 13, 2016
    Posts:
    16
    Thanks for all the help, the project is working now (I realized I had disabled the mesh rendered for the left eye. instead of showing nothing it was showing the right eye which confused me).

    [I only ended up getting difficulties with the OVR packages so I stuck with the VR tickbox]
     
    Last edited: May 17, 2016
  8. maxmp

    maxmp

    Joined:
    Jul 28, 2015
    Posts:
    7
    I tried exactly what you did and have got 360 video working, however i am finding the quality really low.
    I have used ffmpeg to encode to .ogg at 50k bitrate and the video is power of 2 (2048x1024) playing back as a texture.
    I have moved the quality slider on the video up to full, but the video quality is low. The quality also states it is 8k bitrate even though i have encoded it myself.
    When i play the same file back in a browser or on YouTube 360 then it is nice and crisp.
    Any ideas what i am doing wrong?
    Regards
    Max
     
  9. Hughg

    Hughg

    Joined:
    Jan 13, 2016
    Posts:
    16
    Hey Max,

    Is the quality low on Unity or on the GearVR?

    If it's on the GearVR then possibly you can use the StreamingAssets folder to make sure there is no compression going on.



     
  10. Hughg

    Hughg

    Joined:
    Jan 13, 2016
    Posts:
    16
    http://answers.unity3d.com/questions/17409/best-video-preparation-for-unity.html

    Not sure if this helps..

     
  11. Hughg

    Hughg

    Joined:
    Jan 13, 2016
    Posts:
    16
    Does anyone know if there is a way to use the camera effects like twirl to distort a camera only in a fixed direction?

    I'm making a wormhole effect where I have a tube a camera is moving through and I'm using twirl camera effect. Obviously when the GearVR is in the twirl effect follows the camera. This could be fixed using 360 stero video but I was wondering if there is a way to use camera effects at runtime that don't move with the head movement of the GearVR?
     
  12. maxmp

    maxmp

    Joined:
    Jul 28, 2015
    Posts:
    7
    Hi Hughg,
    The problem is in Unity and in Standalone Builds - I have tried different encoding bitrates, but the problem remains.
    I need at least 20k for the video to look good, but Unity still seems to be limiting to 8k.
    Regards
    Max
     
  13. masterchop

    masterchop

    Joined:
    Oct 9, 2015
    Posts:
    39

    what do you use to create the sphere for the video?
     
  14. Martinez-Vargas

    Martinez-Vargas

    Joined:
    Jun 24, 2016
    Posts:
    39
    good afternoon, and I had problems with the resolution of the pictures by unity, I'm using a sphere and within you assign a texture, texture has 4096 in resolution but the quality is very low, any solution for this? thank you very much
    buenas tardes, e tenido problemas con la resolución de las imágenes un unity, estoy usando una esfera y dentro le asigno una textura, la textura tiene 4096 en resolución pero la calidad se ve muy baja, alguna solución para esto? muchas gracias
     
  15. scottunity

    scottunity

    Joined:
    Feb 1, 2014
    Posts:
    72
    4k is less than 900 pixels in the field of view of a gear
    Also note that Oculus/Unity resolution by default is 1k eye buffers. You have to set the resolution scale to 1.5 to get eye buffers to match the device.
     
  16. HiteshSharma

    HiteshSharma

    Joined:
    Mar 24, 2014
    Posts:
    5
    Hi Max, how did you get that 360 video working for Android/GearVR? Did you convert the video in frames? Because as per my understanding, Unity does not support video playing on Android.
     
  17. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    We've also managed to do this using a plugin from the asset store. You'll need some native support to stream a video into a texture. All platforms can do this in hardware, but indeed Unity does not support it out of the box.

    Trying to load in separate frames will probably be too slow. Every phone comes with some dedicated hardware that is great at decoding h263/h264/h265. It's the only way to get the data in the memory quick enough.
     
  18. VenusianArtist

    VenusianArtist

    Joined:
    Dec 4, 2016
    Posts:
    2
    How did you get 360 video to work on Android? surely it wasn't with movie texture, since it isn't supported...
     
  19. Martinez-Vargas

    Martinez-Vargas

    Joined:
    Jun 24, 2016
    Posts:
    39
    [Quote = "VenusianArtist, de la publicación: 2967521, miembro: 1224870"] ¿Cómo consiguió 360 de vídeo para trabajar en Android? sin duda no era con la textura de la película, ya que no es compatible ... [/ quote]

    https://www.assetstore.unity3d.com/en/#!/content/10032