Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Stereoscopic 3D 360 movie bad performance

Discussion in 'AR/VR (XR) Discussion' started by JDMulti, Jan 27, 2015.

  1. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    At the moment I'm experimenting with Stereoscopic rendered 360 movies and display them in the Oculus Rift. I managed to actually have 360 videos appear really 3D with a huge amount of time spend to render it all, however I'm facing one of my last issues in Unity.

    At the moment I've got 2 demos were I play a 2k 360 movie texture in the oculus for each eye. The 3D effect is perfect, the resolution is clear but the performance is poor. My fps jumps between 60 and 45 fps, this results in ghosting on the Oculus Rift.

    The 2nd demo plays back 2x 1k 360 movies, and the performance is just perfect. However the resolution of the videos is poor and everything appears to be blurry which is logical.

    My question is, how can I have 2x 2k videos play at there best in Unity 3D? What can I do about performance and have a steady 60fps when displaying for the oculus rift? 2 Spheres playing each a video is all I have in the scene besides the Oculus Rig. I did read things about setting the pitch of a blank audio track to control the fps of the movies, but nothing else to increase performance.
    Each movie is about 900kb and 4 seconds, I thought this shouldn't have big performance issues, but I'm wrong.
     
  2. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    I've managed to reduce the 2k video's to a bitrate of 250kb/s. The quality is horrible but the fps drop won't be reduced compared to 2k video of 4mb/s. How else can I improve video playback performance? I've downloaded a simple oculus video player, which seems to have zero issues playing 2x 2k videos for the oculus. I guess I'm doing something really wrong or it's impossible.

    Could someone shed some light on this issue?
     
  3. akabane

    akabane

    Joined:
    Apr 26, 2007
    Posts:
    143
    Your best bet would be creating some streaming helpers and compress with ffmpeg or similar, so you can stream them from HDD without having to load them all in memory like unity usually does (reducing performances among other things)
     
  4. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    Stream helpers? You mean streaming the video from the "Resources" folder could improve performance instead of playing it directly from memory?
     
  5. akabane

    akabane

    Joined:
    Apr 26, 2007
    Posts:
    143
    Stream from local disk yes, you should write your own solution, as long as you assign 1 movie load per thread (or you could get up to 2 per thread depending on how you stream)
     
  6. Exsight

    Exsight

    Joined:
    Apr 10, 2014
    Posts:
    33
    Did you use the Movie Texture from Unity to render video on your spheres ?
    Because it will convert your files into OGG Theora format with degradation and Movie Texture performance is not very good at all.

    You could find video plugin on Asset Store that will really help you a lot with playing HD content in format like MP4 but they're not free.
     
  7. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    I do use Movie Texture, but that means the performance is bad? That's strange, I would expect that a default feature would run fine. I however found out that starting a video once with Play() in the Start() function gives a way worse FPS then starting the video in the Update() function. I found that out by trial and error. However it still runs a little shaky but the fps issue is solves so far.
     
    whalan84 likes this.
  8. whalan84

    whalan84

    Joined:
    Apr 12, 2014
    Posts:
    1
    Did you ever find a good solution to this? I am having the same problem. Using the Update() function doesn't seem to help in my case.
     
  9. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    488
    You can't use Unity's MovieTexture for anything remotely HD video related, its performance is just abysmal. The only thing I've found to work well is the AVPro asset - it's not cheap, but it's the best video playback in Unity, at least to my knowledge. It leverages either Quicktime or DirectShow (I would recommend getting the DirectShow, i.e. Windows Media version, unless you're working on Mac) and passes it through to a shader, instead of decoding it all on the CPU.
     
  10. DerrickBarra

    DerrickBarra

    Joined:
    Nov 19, 2013
    Posts:
    210
    Look into Easy Movie Texture if you plan on working in mobile, and try out MPMP as well for mobile/desktop/editor. I personally haven't tried AVPro Windows but it's also a good option from reviews and other forum posters, just remember that it's Windows only and there's a Mac option (AVPro Quicktime) for purchase as well, you'll still need a separate mobile option if you plan on supporting that.