- Home /
Lag of video loading
Hi, everyone. I have been working on a project which has several videos in it. Then I have had a problem, one video loads really very very slow(one has to wait 7s before seeing the video). I have 4 videos in the project for now, the other 3 works fine, and these 3 are captured videos; the 4th, which loads slow, is a computer-made video (3d models, etc).
Unity is not clear on how it deals with video. It uses Quicktime and convert all to ogg/theora format. So I really want to know what is the problem?
The video is somehow big: 70MB. So preloading them may not be a good idea since we could add new videos to the application.
Thanks in advance for your help :)
Have you tried re-encoding the particular video that is slow? You might find some answers here: http://answers.unity3d.com/questions/17409/best-video-preparation-for-unity.html
Thanks you for that! I have tried the method of Paul Clay and that works. It is a good idea to avoid the importer of Unity. Only problem is that Unity can't get the right duration of the video, you have to set it manually.
Answer by Ray-Pendergraph · Jun 11, 2012 at 01:09 PM
We use videos that are over 100MB. Your best bet on this (especially if you have many of them in your game) is to use the WWW class to stream them off of a well known location on the disk. There is an example here of how to do that. Have you tried playing that movie in an external player? If you are still having trouble with that one movie there may be a problem in the source movie converting it so that the decoder is having trouble dealing with it up front. For a while we had these big movies in asset bundles and that does take a while to load as it loads the entire thing into memory.
Thanks you Ray! It sounds nice your method. But I propose you to try the method mentioned by Paul Clay at this URL: http://answers.unity3d.com/questions/17409/best-video-preparation-for-unity.html I have used that method and it works!