Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

How to integrate 360 video with Unity

Discussion in 'AR/VR (XR) Discussion' started by touloused, Jul 27, 2017.

  1. digableMatt

    digableMatt

    Joined:
    Dec 7, 2016
    Posts:
    7
    Are there plans to support images / video with an alpha channel? Currently when using an image with a transparency, instead of being see through, it bleeds the edge pixels to fill.

    I’m using it on a sphere and it works great, just noticed the issue with an alpha channel.
     
  2. max_vr

    max_vr

    Joined:
    Jun 13, 2017
    Posts:
    1
    Situation: We are developing some 360 Video educational modules in the Gear VR.
    Problem: The video lags about a second behind the audio.
    Unity Version: Unity 2017.2.0f3 (also tried Unity 2017.3.0b8)
    Device: Samsung Galaxy S8

    (The issue does not occur when using AVPRO Video player).
    The issue only exists in the phone, not in the editor.

    When a scene loads, the script sends a play command to the Unity video player, but the Audio starts playing a beat or two ahead of the video playing.
    We've tried having it auto-start, or not.
    We've tried having it wait for first frame, or not, and it didn't seem to help.
    We also tested a video that was not produced by us, and it had the same issue.
    Has anyone had similar issues? Suggestions on how to overcome this?
     
  3. isasaurio

    isasaurio

    Joined:
    Nov 13, 2016
    Posts:
    4
    Hello
    I am using Unity 2017.2.0f3 and working for android using gvr (google cardboard).
    In the window "game" the video can be seen well, but when you export the apk and see it on your cell phone, the screen is black, you can not see the video but you can hear it.
    Any recommendations to solve this problem?
    regards
     
  4. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    581
    Known reasons for a black screen is using a video resolution that is higher than the mobile device supports. For example, different Android devices support different 'max resolution' video files. So if you're using a 4096x4096 video file for example, chances are that Android cannot play a video file with that high of resolution. Find out what GPU you have, then check what max video resolution supported for that GPU is.

    You could also try a video player like Easy Movie Texture instead of Unitys Video Player Component.
     
  5. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    58
    Two possible issues - MSAA settings and single pass vs multipass. Try fiddling with those settings and see what happens.
     
  6. SeanMcTex

    SeanMcTex

    Joined:
    Dec 12, 2016
    Posts:
    7
    Is there any prospect that performance for this technique will improve? We've been doing 4K surround video on Android with AVPro, and the player keeps up fine. When I switched the project over to use this workflow, the video stutters and the audio skips.

    I'd like to use this approach, as it stands to make using AssetBundles easier for me, but don't see a way forward with it currently. :( (Developing for Daydream currently, so targeting Pixel and S8.)
     
  7. joshskelton

    joshskelton

    Joined:
    Aug 30, 2013
    Posts:
    10
    I'm having trouble with this. When I go through these steps, my video doesn't playback like it should. it seems that the resolution becomes lower than the original, and I get weird blocks, like it isn't being buffered properly? I'm not sure what the issue is, but the quality looks to be drastically lower than the original video file.
     
  8. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    714
    Panoramic shade not support single pass rendering in android. its copying left eye in Right eye so no Stereo effects come in stereoscopic video. i tried in unity 2017.3
     
  9. joshskelton

    joshskelton

    Joined:
    Aug 30, 2013
    Posts:
    10
    @touloused: what do you think?
     
  10. MikePeters

    MikePeters

    Joined:
    Sep 19, 2017
    Posts:
    2
    This was working great, but as of lately, I've been getting a visual seam in the back (180) portion of the video, it wasn't there when I first tried to use this skybox shader, but it's there now.

    Edit: 14 Dec 17
    Just to add to this post, I've checked things out with the beta of 2017.3 and I'm having the same issue. Also, I've made a new project and have just brought in just the video and the skybox. Everything is working fine, so I'm guessing it's some player/build setting that was changed to optimize things, but I can't for the life of me figure out which one. I should also add that yes, the render material is set to the correct size, and wrap mode is set to clamp.

    Edit 2: Ok, have two different fixes, at least for my issue, both come from the render material. Either disable Mip Maps, or turn on Anti-Aliasing (2 samples was enough). I suppose you could try both, but individually, they removed the line (seam) in my 360 video.
     
    Last edited: Dec 14, 2017
  11. phili_maas

    phili_maas

    Joined:
    Dec 11, 2016
    Posts:
    18
    Github version of the shader works for me on Mobile VR Daydream with Single Pass Stereo and Unity 2017.3.0f2.
    Working also fine in the Editor with Oculus.

    But Gear VR on the other hand is showing only right eye image on both eyes.
     
  12. yannis_1

    yannis_1

    Joined:
    Mar 28, 2017
    Posts:
    1
    Hello all

    In the video here
    it seems that with the latest version of Unity you can integrate 3D models in 360 videos. Anybody knows a good tutorial on how to do this?
     
    avclubvids likes this.
  13. avclubvids

    avclubvids

    Joined:
    Jan 6, 2015
    Posts:
    11
    @touloused – first and foremost I'm excited about all of this – native Unity video cube maps in particular have been REALLY high on my list for years. One thing I'm sad to see is the lack of stereo cube maps, any thoughts on supporting them? There are a few formats we've used for this outside of Unity, 12x1 and 6x2 are two of them, but there are others.

    You're so close!
     
  14. ralarson

    ralarson

    Joined:
    Feb 13, 2018
    Posts:
    6
    Hi, I have been experimenting with the skybox panoramic shader and the video player and have some questions about its capabilities and limitations. I noticed on the video player scripting page it says "The VideoPlayer uses native audio and video decoding libraries in its implementation..." and "You may choose to omit this transcoding and instead use videos that you already know are supported by the target systems, keeping finer control over the encoding process using an external program." Does this mean that the Unity Video Player component with the skybox panoramic shader beta are capable of rendering video of any format that is supported on the device? I want to play videos that are already in a format that supports very high resolutions (4096x4096) on devices that should be capable of decoding it. Basically I am asking if Unity, the video player, or the panoramic shader will prevent what I am trying to do. FWIW have already achieved playback of 4096x2094, 3D, lat-long, over under MP4s that were downloaded to device and played in the video player from the file.
     
  15. Fortitude3D

    Fortitude3D

    Joined:
    Sep 7, 2017
    Posts:
    155
    Thankyou so much, looks impressive, very good!
     
  16. jlee-lee

    jlee-lee

    Joined:
    Dec 26, 2014
    Posts:
    1
    @touloused Hi we're having issues with the transcoding for 360 video, it's a mono application but our video has a lot of movement, cable camera shots, drone shots etc. While the video looks good with no movement it breaks apart as soon as the camera has motion. Un transcoded it works great, but frames drop as soon as there is movement in the shot. Can u provide any guidance here for encoding or transcoding options that can help fix this?

    Thanks
     
  17. dornhege

    dornhege

    Joined:
    Mar 24, 2017
    Posts:
    2

    Attached Files:

  18. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    525
    Still not clear how to use stereo video for this. Can some one add a guide?
     
  19. ralarson

    ralarson

    Joined:
    Feb 13, 2018
    Posts:
    6
    @rahuxx have you seen this guide? Stereo should work out of the box with the panoramic shader and latest Unity.
     
    rahuxx likes this.
  20. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    525
    Thanks.
    A quick question, can we use 360 single image for same?
     
  21. ralarson

    ralarson

    Joined:
    Feb 13, 2018
    Posts:
    6
    Yes, instead of using a render texture for the skybox material you would just use your still image texture in exactly the same way, assuming your still is in a recognizable format (eg 6 frames/Lat-Long, Over-Under/Side-By-Side)
     
    rahuxx likes this.
  22. lowtechfilm

    lowtechfilm

    Joined:
    Mar 11, 2018
    Posts:
    1
    HI, I have a question about WebM 360 video. I use Gear360 Action Director to create a stitched MP4. But I want to use WebM for Unity. Part of my workflow integrate Linux/FFMPEG so I can create an image sequence and re-encode WebP still images into a WebM VP8 video file. I have tried this but I cannot get the file to work in Unity. It previews but does not render as a material. Is there a detailed WebM encoding list/file format for Unity?
     
  23. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    50
    hi guys i have the Player up and running perfectly, i can jump around in the video track by passing framenumbers.
    I used the purplepill VREncoder and it plays the video like perfect on the following specs:
    monoscopic 4k 3840x1920@29.97 as h265

    but the audio thing happens:
    Now i have also an Audio inside my video file, when i play on PC u can hear its there.
    but when i try to use the direct mode for Audio on GearVR in my Samsung galaxy nothing happens
    its android 7
    Modell number SM-G930F
    unity 2017.2.0f3 as recommended for this Android SDK

    I'am not sure what iam doing wrong, i setup in Inspector (import) Import Audio (no transcode)
    on the videoplayer i set
    Audio output mode: direct
    in c Sharp i set :
    Code (csharp):
    1.  
    2.  // play Video on awake etc
    3.         m_videoPlayer.playOnAwake = true;
    4.         m_videoPlayer.waitForFirstFrame = true;
    5.  
    6.         // set prepare event
    7.         m_videoPlayer.Prepare();
    8.  
    9.         while(!m_videoPlayer.isPrepared)
    10.         {
    11.             yield return null;
    12.         }
    13.  
    14.  
    15.         //Set Audio Output to Direct because its seems the checkbox on gui does not work or my galaxy does not care
    16.         m_videoPlayer.audioOutputMode = VideoAudioOutputMode.Direct;
    17.         m_videoPlayer.EnableAudioTrack(0, true);
    18.  
    19.  
    but still noting on severall headphones.

    - any ideas?

    Any ideas or help i would very appreciate.

    pascal
     
  24. ralarson

    ralarson

    Joined:
    Feb 13, 2018
    Posts:
    6
    Do you have an audio source in your scene?
    You need to:
    • set controlledAudioTrackCount on the video player
    • set target audio source to your audio source in the scene
     
    pachermann likes this.
  25. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    50
    Hey ralarson,

    thanks for the help,
    no i don't have an AudioSource <component> i want to play the audio source directly from the videofile.

    That is why i set the direct play Checkbox and the settings:

    Code (csharp):
    1.  
    2.         //Set Audio Output to Direct
    3.         m_videoPlayer.audioOutputMode = VideoAudioOutputMode.Direct;
    4.  
    this manual says like the audio is sended direct to my android hardware :)
    https://docs.unity3d.com/2017.2/Documentation/ScriptReference/Video.VideoAudioOutputMode.Direct.html

    SetTargetAudioSurce is as far as i understand when i have a AudioSource <component> in inspector.
    But iam not sure what i need to just tell my unity app to play this audio track from the videofile.
    When i copy the video raw into the mobile it plays the audio and video without any problems.

    maybe you know how to do this? :)
     
  26. Jami_Siili

    Jami_Siili

    Joined:
    Aug 3, 2017
    Posts:
    1
    Slightly unrelated, but I would've assumed H.265 support would eventually be good for 360/180 streaming. Is there any plans for that?
     
  27. ralarson

    ralarson

    Joined:
    Feb 13, 2018
    Posts:
    6
    @pachermann
    I've just tried using direct audio output mode and lost my audio even when testing in the editor. I was however able to hear audio when I reverted back to using the audio source and setting that as the first audio source on the video player. Give it a try by just adding the audio source component, setting the controlled audio track count to 1, and setting the target audio source to the one you added and you should be able to tell right away.

    I would expect the video file to play with the audio when you drop the raw file into your device as it would be using native functionality depending on what player you used it with. I have no idea why "direct" is not working as documented.
     
    pachermann likes this.
  28. ralarson

    ralarson

    Joined:
    Feb 13, 2018
    Posts:
    6
    Based on the number of companies that are offering streaming support by implementing extra encoding/decoding steps to deliver content high resolution enough to get the max resolution for just the view frustum the device is capable of, I am going to assume that streaming H.265 is beyond common consumer download speeds and that the extra encode/decode step is necessary.
     
    pachermann likes this.
  29. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    50
    @ralarson , hy supercool that you answered again.
    I will try this solution right away.
    It is still the solution that would spare me many hours of coding with seperate audio.

    If it works i post the solution here.

    Have nice day!
    Pascal


     
  30. gamingdave

    gamingdave

    Joined:
    Mar 23, 2018
    Posts:
    2
    Hi @pachermann did you get a solution for this?

    Having the same issues, with sound playing fine in the editor, but not at all on Gear VR. It doesn't work in the sample 360 video project with the default files, or any others I have tried.
     
    pachermann likes this.
  31. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    50
    @gamingdave it worked now, i want to summarize what i did to play the video with the embedded audio.
    But i found out that also the way i coded it is no so 100% the right way, so i will recode everything ^^

    by the way i use this on a android and i wont play on windows unity editor, to optimie the video for android playback i use the VRencoder with the exact resolutions they say are working on their websit from purplepill because it seems it works very good.
    We had to presharp the 360 video because the compression makes it a bit blurry somethimes.

    Here is my main player, with all the buttons for jumping around and the osvr gazeController etc.



    when you add the video to the player and you tel the importer of the video to import audio track.
    Then you get this Track 0 [2 ch] with the checkbox (the dropdown of coarse need also to be set on Audio Source)
    On the same object i put on the Audio source component. (empty because it seems it just need to be there)

    Code (CSharp):
    1. // vars    i used
    2. public VideoPlayer m_videoPlayer;
    3. public bool m_playVideoFlag = false;
    4. public bool m_playVideoAgainFlag = false;
    5.  
    6. public AudioSource m_SingleAudioSource;
    7.  
    8. // then inside may IEnumerator playTheVideo Function
    9.       m_videoPlayer.playOnAwake = true;
    10.         m_SingleAudioSource.playOnAwake = true;
    11.  
    12. //Set Audio Output to Direct
    13.         m_videoPlayer.audioOutputMode = VideoAudioOutputMode.AudioSource;
    14.  
    15.   m_videoPlayer.controlledAudioTrackCount = 1;
    16.         m_videoPlayer.EnableAudioTrack(0, true);
    17.         m_videoPlayer.SetTargetAudioSource(0, m_SingleAudioSource);
    I never found out what the direct play thing is doing, i used this audisource Api calls to play the audio source from within the video and it worked fine.

    hope this helps some peoples to play the video with audio :p
     
    gamingdave likes this.
  32. gamingdave

    gamingdave

    Joined:
    Mar 23, 2018
    Posts:
    2
    pachermann likes this.
  33. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    50
    Glad it helped!
     
  34. Neogene

    Neogene

    Joined:
    Dec 29, 2010
    Posts:
    72
    In my case first time the scene is loaded is black (I'm using panoramic 2D), when reloading the scene coming from another one it is visible.
     
  35. klutzgames

    klutzgames

    Joined:
    Apr 6, 2015
    Posts:
    10
    Help with 5k 60fps Videos

    Hi, I build a VR player with Unity and we need to play videos with the resolution 5120x2560 with 60fps on a Windows 10 PC.
    Did anyone manage to run this within Unity without stuttering? I currently use the VIVE media encoder from the asset store, but we can see stuttering in fast moving objects.
    The computers are very powerful and the gpu/cpu is not very busy playing the video. Also we don't mind about the video codec. Best results so far we had with H264.
    We don't mind buying a media play pack asset from the store as long as we can be sure that it works.
    I tried the "AVPro Video" demo but it also stuttered.

    When we use the GoPro 360 Player, we only get a good result using the old 2.3 Version with the VLC player backend and H264. All other combinations also stutter.

    Playing the video with a player without VR usually is no problem at all.

    Any suggestions are appreciated!
    Thanks!
     
  36. Megasa

    Megasa

    Joined:
    Sep 30, 2016
    Posts:
    1
    Hello! I used your solution in my project. For example, I used the video from the asset. I added a few cameras and a script to switch between them. Everything works without errors. After compiling on my computer everything works well. However, on other computers, the video stops working for 2 seconds. Is there a problem? How to fix? Thanks.
     
  37. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    50
    Hi folks, this answer is for the mediate users like me, who can't figure it out.
    i like to share this for the love of craft :love: :p

    First, i wanted for my client to use a galaxy S7, the performance is horrible, i found out to late in my opinion (or my skillz and time).
    I don't wanted an Iphone because apple don't like 360 Video in terms of resolution its trash. ( it max 1k :confused: )
    I found out that you even must go to Powersettings of the galaxy phone and enable full performance in order to play the video proper. ( afther that the S7 can play with the right codec amazingly UHD :D)

    I did manage the menu and so on, but mostly it fails because something is not working like i think it should.
    That being said, i'am just to noobish still to fully understand the process of this player and i can't debugg on the S7 because i don't see a console and what goes wrong.
    If i manage it working i will post it then also...

    On PC i can do all the tricks i want it just work fine.
    As well on VIVE and mixed reality headsets from Microsoft it runs awesome smooth!
    I guess the pc forgives my mistakes ;P

    I look forward to the occulus GO and hope they don't F*** it up i terms of software chaos like they did with the occulus kit. (its terrible chaotic and never updated manuals, even 10x more trial error... )

    i used OSVR for the gaze Controller and it work so fine it has clear instructions what SDK and what unity version you need for what Android phone. :love: :D

    About the Videoformats:
    Use the purple pill codec ripper for the android codec and if you can afford davinchi resolve studio :D (the free version works also to but has max RES UHD).
    Wirking with these tools is so smooth and intuitive after using the premier 360 tools for the editing:

    I put 5 sec blank frames in front so the Android have enough time to be in sync :eek:



    do not forget to make 1 Track for the audio ;)


    And then from the davinchi file make the android codec with purple pill
    (i did presharpen in davinchi very slightly because the h265 get slightly blurry)




    Some of my biggest fails was that i wanted to use play() and pause() in conjunction with some IENumerators. The solution was like using the play() and pause() outside just in the class like you do in javaScript and they worked. I'am lucky to have a mentor who helps me when i start to drown :D

    I know i do weird thing with my update, but the normal function for determining the end of the video does not work at all on the galaxy mobile.
    I had to get a double inside a if() statement and set the halt manually before the end of the video.
    Code (CSharp):
    1.  public ulong Duration
    2.     {
    3.         get { return (ulong)(m_videoPlayer.frameCount / m_videoPlayer.frameRate); }
    4.     }
    5.  
    6.  
    and inside update
    Code (CSharp):
    1. void Update()
    2.     {
    3.         currentTime = m_videoPlayer.time;
    4.  
    5.         //time
    6.         if (currentTime >= 251.88)
    7.         {
    8.             //Debug.Log ("ich mache Pause");
    9.             m_videoPlayer.Pause();
    10.             // activate the Reticle and the Canvas
    11.          
    12.             m_reticle.SetActive(true);
    13.  
    14.             if(!m_videoPlayer.isPlaying)
    15.             {
    16.                 m_mainCanvas.SetActive(true);
    17.             }
    18.         }
    19.     }
    Anything else did not work (i mean the api funnctions like:)
    • VideoPlayer.loopPointReached.
    • videoPlayer.loopPointReached += EndReached;
    • void EndReached(UnityEngine.Video.VideoPlayer vp)
    no chance at all with these on my galaxy S7 mobile
    (yes on pc it worked but not on the android)


    I then pause the video but in the background it runns somehow still.
    only on double click on the menu button it will accept the new frame and play the video.
    But yea it work finally somehow :p


    Inspector:




    The Code (player):

    Code (CSharp):
    1. using System.Collections;
    2. using System;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.UI;
    6. using UnityEngine.Video;
    7.  
    8. //[System.Serializable]
    9. public class player : MonoBehaviour
    10. {
    11.     // NFO
    12.     // a_ locale new private variable
    13.     // functions private variables nameName
    14.     // m_ Member variable
    15.  
    16.     // misc variables
    17.     public int m_newFrame;
    18.  
    19.     public GameObject m_reticle; // kleiner, grüner Kreis
    20.  
    21.     public double videoTime;
    22.     public double currentTime;
    23.  
    24.     // sources and start flags
    25.     public VideoPlayer m_videoPlayer;
    26.     public AudioSource m_SingleAudioSource;
    27.  
    28.     // Materials
    29.     public Material m_skyBoxMaterial;
    30.  
    31.     // public canvas
    32.     public GameObject m_mainCanvas; // Menüauswahl
    33.  
    34.     // list of all relevant buttons who want to trigger a video chapter
    35. // this is only to view a list in inspector for orientation, they do not make anything at all ;)
    36.     public List<Button> m_chapterSelectButtonList;
    37.  
    38.     bool isDone;
    39.  
    40.     public bool IsPlaying
    41.     {
    42.         get { return m_videoPlayer.isPlaying; }
    43.     }
    44.  
    45.     public bool IsPrepared
    46.     {
    47.         get { return m_videoPlayer.isPrepared; }
    48.     }
    49.  
    50.     public bool IsDone
    51.     {
    52.         get { return isDone; }
    53.     }
    54.  
    55.     public double Time
    56.     {
    57.         get { return m_videoPlayer.time; }
    58.     }
    59.  
    60.  
    61.     public ulong Duration
    62.     {
    63.         get { return (ulong)(m_videoPlayer.frameCount / m_videoPlayer.frameRate); }
    64.     }
    65.  
    66.     // video player class events
    67.     void OnEnable()
    68.     {
    69.         // subscripe to events in the player class
    70.         //m_videoPlayer.frameReady += frameReady;
    71.         m_videoPlayer.prepareCompleted += prepareCompleted;
    72.         m_videoPlayer.seekCompleted += seekCompleted;
    73.     }
    74.  
    75.     void OnDisable()
    76.     {
    77.         // Unsubscripe to events in the player class
    78.         /// m_videoPlayer.frameReady -= frameReady;
    79.         m_videoPlayer.prepareCompleted -= prepareCompleted;
    80.         m_videoPlayer.seekCompleted -= seekCompleted;
    81.     }
    82.  
    83.     void loopPointReached(VideoPlayer v)
    84.     {
    85.         isDone = true;
    86.     }
    87.  
    88.     void prepareCompleted(VideoPlayer v)
    89.     {
    90.         isDone = false;
    91.     }
    92.  
    93.     void seekCompleted(VideoPlayer v)
    94.     {
    95.         isDone = false;
    96.     }
    97.  
    98.     void Start()
    99.     {
    100.         // initialize background tasks for a more stable play
    101.         Application.runInBackground = true;
    102.  
    103.         // get the length of the clip attached to the player
    104.         videoTime = m_videoPlayer.clip.length;
    105.         //start the videoplayer
    106.         m_reticle.SetActive(false);
    107.         StartCoroutine(playTheVideo());
    108.     }
    109.  
    110.     // Update is called once per frame
    111.     void Update()
    112.     {
    113.         currentTime = m_videoPlayer.time;
    114.  
    115.         if (currentTime >= 251.88)
    116.         {
    117.             //Debug.Log ("ich mache Pause");
    118.             m_videoPlayer.Pause();
    119.  
    120.             // activate the Reticle and the Canvas
    121.             m_reticle.SetActive(true);
    122.  
    123.             if(!m_videoPlayer.isPlaying)
    124.             {
    125.                 m_mainCanvas.SetActive(true);
    126.             }
    127.         }
    128.     }
    129.  
    130.     public void JumpToTime(int a_newTimeKeyframe)
    131.     {
    132.         //Debug.Log ("player ist hier");
    133.         m_videoPlayer.frame = a_newTimeKeyframe;
    134.      
    135.         //Debug.Log ("player ist hier2");
    136.         m_videoPlayer.Play();
    137.         m_mainCanvas.SetActive(false);
    138.         m_reticle.SetActive(false);
    139.         //Debug.Log ("player ist hier3");
    140.     }
    141.  
    142.  
    143.       // bereitet den Videoplayer vor, startet diesen aber nicht
    144.     IEnumerator playTheVideo()
    145.     {
    146.         // play Video/audio on awake and hold till first frame is laoded
    147.         m_videoPlayer.playOnAwake = true;
    148.         m_videoPlayer.waitForFirstFrame = true;    
    149.         //Set Audio Output to Direct
    150.         m_videoPlayer.audioOutputMode = VideoAudioOutputMode.AudioSource;
    151.         // this is a feature that is only before version 2017.3.0
    152.         // in 2017.0.0 it should be set automatically from metadata of the video
    153.         m_videoPlayer.controlledAudioTrackCount = 1;
    154.         m_videoPlayer.EnableAudioTrack(0, true);
    155.         m_videoPlayer.SetTargetAudioSource(0, m_SingleAudioSource);
    156.         // set prepare event
    157.         m_videoPlayer.Prepare();
    158.         while (!m_videoPlayer.isPrepared)
    159.         {
    160.             yield return null;
    161.         }
    162.         m_videoPlayer.isLooping = false;
    163. // debuger jump to the end to test the video :P
    164.         //m_videoPlayer.frame = 7200;
    165.         m_videoPlayer.Play();
    166.         // hier ist der Player fertig initialisiert, Koroutine ist beendet
    167.     }
    168.  
    169.  
    170. }
    171.  
    Button code:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5.  
    6. public class ButtonBehavior : MonoBehaviour {
    7.  
    8.     // info
    9.     // a_ locale private variable
    10.     // m_ Member variable
    11.  
    12.     //other scripts references
    13.     public player m_playerScriptReference;
    14.  
    15.     // Member variables
    16.     public Button m_thisButton;
    17.  
    18.     // buttons framepostion for reaching their chapters
    19.     // if clicked every button sends this frame number and Audio pos
    20.     public int m_thisButtonChapterFrameNumber;
    21.  
    22.     public void GetChapterFrameNumbers()
    23.     {
    24.         m_playerScriptReference.JumpToTime(m_thisButtonChapterFrameNumber);
    25.     }
    26.  
    27.  
    28. }
    29.  
    Please forgive my chaos code.... :p
    But it works and i hope it gives some workflow.

    i sincerely hope some people can use this and saves them many hours of trying and wasting time.
    happy hacking guys :=)
     
    WaterlaneStudios likes this.
  38. tobermanar

    tobermanar

    Joined:
    Aug 17, 2016
    Posts:
    4
    It works great. That's a very effective way to do an expensive contemplating scene on Gear VR or Google Cardboard. Streaming video is "easy" for most smartphones while rendering even the most basic environment can be painful.

    @touloused have you thought about turning it into a package ? With an example scene and everything ? This could be a very quick way to get going for non developers.

    I have done a small package myself, if your are interested by some sharing, I'll be glad to clean it up and add it to github.
     
    pachermann likes this.
  39. zulaman

    zulaman

    Joined:
    May 12, 2017
    Posts:
    3
    Is there a way to use the skybox shader on geometry (sphere)?
    The goal is to have a 360 image for the skybox and a hemi-sphere geometry playing a 180 video.
    Thanks
     
  40. risto_aa

    risto_aa

    Joined:
    Apr 3, 2018
    Posts:
    12

    Any news on this?

    My 180 stereo 2880 x 1440 60fps video just jitters and tears like mad.
    I also did experiments with the AVPro plugin, there the video plays smoothly but it is stretched vertically, like really bad. AVPro is investigating the issue atm, but if there's any news on this panoramic shader, I would love to hear. Any workarounds. Been with this project well over a year now (made with Octane Render, and is tuned to knock peoples socks off :) ), so I would really like to close this project, and send it to the Oculus Store for review. I am badly stuck right now.

    Thanks in advance.
     
  41. yuehaowang

    yuehaowang

    Joined:
    Aug 13, 2017
    Posts:
    6
    Hi, @touloused

    I am trying to build my project on macOS but I come across problems on running the application after Unity build this project successfully. The application always keep loading in a black window. I am wondering whether I miss some key steps on the setup of the project before starting build. Or this problem may come from other mistakes?
     
  42. Onsterion

    Onsterion

    Joined:
    Feb 21, 2014
    Posts:
    206
    Hi @touloused.


    I tested the tutorial and the 360 videos from "Interactive 360 Sample Project" in the asset store (https://www.assetstore.unity3d.com/en/#!/content/108974) this looks amazing in Unity.

    But I spended all the day trying to put a 360 degree video from youtube and vimeo in to Unity for testing other videos but all the results are bad the video are very zoomed and cutted.

    In Youtube and vimeo look greatos in unity horrible.


    Have any tutorial for how to modify 360 videos to Unity format?



    Regards.-
     
    Last edited: May 7, 2018
  43. IEA_DOT

    IEA_DOT

    Joined:
    Nov 28, 2016
    Posts:
    2
    I'm studying the possibility of adding an option to the 180 image type at the Skybox/Panoramic shader editor. If "Mirror on Back" is disabled, there will be an option to load a Texture2D for the back.

    Do anyone have a ready solution? Now I have the codes at https://github.com/Unity-Technologies/SkyboxPanoramicShader, but I have no experience with shaders.

    Thanks in advance!
     
  44. Gerwald-Radsma

    Gerwald-Radsma

    Joined:
    Dec 24, 2014
    Posts:
    7
    My hero!
     
  45. yuehaowang

    yuehaowang

    Joined:
    Aug 13, 2017
    Posts:
    6
    I have solved this problem eventually. I forgot setting the 'Depth Buffer' option to 'No Depth Buffer' and this is a crucial step.
     
  46. schulmkg

    schulmkg

    Joined:
    Aug 25, 2017
    Posts:
    7
    Ok I must be stupid... I followed the instructions and my video still plays like a giant 360 degree bubble - well actually it just plays a black screen

    I think where it is going wrong is in the Render object since the instructions say I should be seeing frames getting imported and nothing like that happens


    I've attached screen shots of each step along the way. any ideas on what I've done wrong?
     

    Attached Files:

    Last edited: Jun 6, 2018
  47. schulmkg

    schulmkg

    Joined:
    Aug 25, 2017
    Posts:
    7
    Hello? anyone?
     
  48. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    50
    Hey Schulmkg

    iam not sure what the problem is.
    did you concider all details, for example on my example?
    it shows easy setup with internal unity player.

    not sure what you mean by render object.
    also whats confusing me is your screenshot show different skybox materials with different settings.

    maybe you just setup a new clean scene and go step by step trough it, then setup the c sharp script up step by step.

    good luck
     
  49. WaterlaneStudios

    WaterlaneStudios

    Joined:
    Mar 13, 2015
    Posts:
    46
    Any thoughts on differences between using/setting up the following 3 types of media in a Unity scene? I'm really curious about other methods of setting up stereo 180, if anyone has tried this do you have any examples?

    1. 360 video
    2. 360 stereoscopic video
    3. 180 stereoscopic video

    Has anyone tested stereoscopic/standard input videos - both being played with a standard camera vs a stereo/vr camera?
    Cheers.


    >>>>UPDATE >> I've decided to set up a new thread in this group - hopefully to get some discussion going on different types of '180/360' footage with unity.
    The threads titled '180 vs 360 + Lenovo's Mirage Camera' - It would be great to hear people experiences :)
     
    Last edited: Jun 18, 2018
  50. newnewnewnewbie

    newnewnewnewbie

    Joined:
    Jul 12, 2017
    Posts:
    1
    Can I change the texture of the material during run time in script? I used Material.SetTexture but no respond. I think it is because the shader used is not the build shader. How can I access the Sperical(HDR) attribute using script? Since it is the slot where I dragged texture in.