x


Animated GIF and Audio Instead of Video?

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?

-Biendeo

more ▼

asked Sep 22 '10 at 06:43 AM

Biendeo gravatar image

Biendeo
127 12 13 24

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Sep 22 '10 at 06:56 AM

Ashkan_gc gravatar image

Ashkan_gc
9.1k 33 56 117

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Nov 24 '10 at 06:03 PM

yoyo gravatar image

yoyo
6.4k 25 39 84

Hmm, 1280x720 may have been a lie, on looking back at the content I think I rescaled to 640x360 to improve load times.

Jan 01 '11 at 05:58 PM yoyo

I am certainly interested in this. Being unable to afford Unity Pro but requiring the functionality, I am between a rock and a hard place. Any help or advice would be awesome - but I would looking for something relatively simple being a novice.

Nov 11 '11 at 02:39 AM MightyMatty

@yoyo, I looked at the web player demo on your website for BMovieTexture, and it looks impressive. I would be very interested in seeing the details/code for that! Thank you!

Feb 20 at 07:04 AM grojguy
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1026
x280
x256
x58
x11

asked: Sep 22 '10 at 06:43 AM

Seen: 4390 times

Last Updated: Feb 20 at 07:04 AM