Since I'm using Unity Free, I know I'm not able to insert any type of video file into my game. However, I have been looking around, and I've come across that animated GIF files can be used in Unity. If so, how can I project an animated GIF onto my whole screen (or more or so, just show the GIF full-screen).
Also, since I can do that, I was wondering if I could also play an audio file over that, maybe to accompany the animated GIF. Is that also possible?
asked Sep 22 '10 at 06:43 AM
it's not possible to play animated gifs in unity. you can convert them to a strip or multiple textures and then change the texture of your material yourself. see this question.
you can play audio using an audio source when animating your texture.
you can also write your own gif parser if you want.
using animated gifs instead of movies is not an option for long videos.
answered Sep 22 '10 at 06:56 AM
I wrote a "video" player for the free version of Unity. (I called it BMovieTexture, since it's a low budget version of the MovieTexture class). It triggers an audio clip, then plays back a sequence of images at an appropriate frame rate.
I used ffmpeg (freely available) to rip video into individual frames and extract the audio. I then load the frames one by one from the hard drive and display them, monitoring elapsed time to control playback speed. Unity free doesn't have an asynchronous file loader, but I was able to get some asynchronicity by using the WWW interface (with a "file://" URL).
Without full asynchronous streaming, performance isn't the greatest. On my laptop (relatively new and fast) I can play 1280x720 video at about 15 frames/second. Quarter-resolution is fine at 30 fps.
If anyone is interested I can dig up more details.
answered Nov 24 '10 at 06:03 PM