0

I found the way to generate movie from a bunch of images (iOS: How to generate a video file via images/audio?). But this is not an option for me. I want to present images from iPhone Photo Library in high speed (~0.2 secs per photo) without movie generation. Is it possible?

Community
  • 1
  • 1
qubblr
  • 45
  • 4
  • Tried this: http://stackoverflow.com/questions/3983882/assetwriterinput-for-making-video-from-uiimages-on-iphone-issues. It works fine, but takes time to generate video with 100(or more) images. I want to allow user to start demonstration without delay, by presenting pure images without video generation. – qubblr Nov 26 '13 at 07:26

2 Answers2

0

Not sure if this meets your speed requirement or even works but here goes:

cf/ Trying to change a UIImageView each 10 seconds

// more likely you will use a for loop to build this array
// (point is, make an array of images that you want to show)
NSArray *imagesToAnimate = @[imageOne,imageTwo, imageThree, imageFour ... imageN];

int numImages = [imagesToAnimate count];
double refreshInterval = 0.2;

// because 1 / (SECONDS/ IMAGE) = IMAGES / SECOND

double desiredFPS = 1/refreshInterval;

imageView.animationImages = imagesToAnimate;

// because IMAGES / (IMAGES / SECOND) = SECONDS

imageView.animationDuration = numImages/desiredFPS;

[imageView startAnimating];
[imageView stopAnimating];

Having never used the animationImages I don't know how it performs - I don't see why it wouldn't but maybe you have to do some low-level stuff to have the images "ready to go" instead of doing a read for each refresh. I would think though that the folks who designed this library would have done some performance tuning but I'm not sure.

Community
  • 1
  • 1
tacos_tacos_tacos
  • 10,277
  • 11
  • 73
  • 126
0

You can use UIImageView's animationImages property :

Dani Pralea
  • 4,545
  • 2
  • 31
  • 49