What shows the best performance? Playing a video clip or animating a sequence of images using UIImageView?

Specifications: about 320 x 270 pixels, 5 seconds. I don't know exactly how many images are required for a fluid animation, but let's say 30.

What would be the best way to reproduce this? As a movie file as a quick view (if available) or as a sequence of animated images with a UIImageView? I'm not sure, but I find that downloading 30 images per second is almost impossible on iPod touch. Any idea?

+2


source to share


3 answers


Why don't you want to use the video file? Unless you have a specific reason, I would recommend using the standard video playback features provided by Apple.

This gives you several benefits:

  • Even if your suggested method runs smoothly, it will certainly not be optimized for the graphics chip and therefore will use more battery.
  • It is very easy to implement, whereas your idea is going to be quite complex and you will spend a lot of time on a probably less important part of your application.
  • It won't introduce any new bugs and will most likely be much better tested than your custom solution.


Check it out to get started:

http://developer.apple.com/iphone/library/navigation/index.html?section=Topics&topic=Audio%20%26amp%3B%20Video

0


source


In general, the movie will apply some compression, and may even use lossy compression. This means that the processor has to work more intensively, but much less memory is required to read. The CPU is a fast resource. Compared to the processor, the memory is slow. Thus, a compressed movie will (logically) have better performance.



In practice, this can depend on many factors, although movies are generally better optimized for animation. With a slow processor and extremely fast memory, animations with multiple images can be faster. Also, it depends on how you store these many images. But in 99% of all situations, movies will have the best performance.

+4


source


Well, I guess it depends .... if it has to be static than movie is the most appropriate way ... it's hardware accelerated and it's easy to write code to use it. If you plan on modifying the animation and reusing it, you can load and modify the images, or load them one at a time, but I think this is pretty tricky coding for the task.

+1


source







All Articles