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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[SOLVED] Importing huge videos into Unity

Discussion in 'AR/VR (XR) Discussion' started by Tronno, Apr 23, 2015.

  1. Tronno

    Tronno

    Joined:
    Apr 23, 2015
    Posts:
    11
    Hi there! I am building a 360-degree video app that projects a MovieTexture onto a sphere. However, I'm having trouble importing the rather large video texture (150MB). Unity always hangs and the loading icon continues indefinitely.

    I can force-quit Unity and restart to continue working, but I get this message after the restart:
    Force-quitting also seems to corrupt the file. The asset icon is different (it's a Quicktime logo instead of a "filmstrip"), I can't expand it to see the embedded audio clip, and when I try to assign it as a MovieTexture, it's not displayed in the asset list dialog.

    When I try the above with smaller files, they successfully import, and I can use them no problem. Same settings, just a shorter video.

    Has anybody encountered this before, and do you have any fixes or workarounds? I am using Unity 4.6.4f on OSX 10.10.2.
     
    Last edited: Apr 24, 2015
  2. Tronno

    Tronno

    Joined:
    Apr 23, 2015
    Posts:
    11
    Nevermind! The solution was to let Unity chug away overnight. It does successfully import the large video file after about an hour.
     
    VearVolk likes this.
  3. Dotbot

    Dotbot

    Joined:
    May 5, 2015
    Posts:
    2
    Have you solved playing MovieTexture on Android? Or you are not deployong on Android at all?
     
  4. Tronno

    Tronno

    Joined:
    Apr 23, 2015
    Posts:
    11
    Yes, I used the EasyMovieTexture plugin. It's messy and the documentation sucks, but it gets the job done.
     
  5. Dotbot

    Dotbot

    Joined:
    May 5, 2015
    Posts:
    2
    Yea ok. Im trying to get around that. :D
     
  6. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    297
    @Tronno
    At import time, Unity converts the video to ogg vorbis.
    If you author your video to ogg vorbis, you'll have instant imports.
     
    TooManySugar likes this.
  7. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,000
    You can also do the conversion from commandline (can see the progressbar there and could run multiple of these)
    Code (CSharp):
    1. ..Unity5\Editor\Data\Tools\QuicktimeTools.exe "transcode" "-input" "yourvideo.mp4" "-output" "yourvideo.ogg" "-vbr" "4100000.000000" "-abr" "156000.000000"
     
  8. Cosmodrome

    Cosmodrome

    Joined:
    Aug 3, 2012
    Posts:
    6
    In my opinion, the best way to do that is leaving the movie out of the project, loading it at runtime with EasyMovieTexture.
    Importing a huge movie in Unity requires a very long time, as you discovered, and could also cause crashes as the project size grows over a certain limit.