2

I'm quite new to iPhone SDK and I have been trying to solve a problem for some time now, but I can't get it to work properly. My problem boils down to transiting from one video to another seamless. That is no flickering or stop of the video when transiting.

I've tried a bunch of different solutions. MPMoviePlayerController, AVPlayer and also splitting the movie's into images and do the animation myself.

Going for the image animation is not really viable for me since I have to much data (more that one video) that needs to be possible to display at start of application. Forcing the images to load from file into memory like here will result in a non acceptable start-up time.

I have been reading and researching a lot, but there is a lack of new (since 4.0) information about this subject.

What I wonder is if anybody has been able to loop videos (flicker free) with AVPlayer (or some third-party library), or if this is a complete dead end?

BTW: Im testing on a 3g device running IOS 4.1.

Community
  • 1
  • 1
devdevdev
  • 21
  • 2

2 Answers2

0

I have worked on this specific problem, and the bottom line is that there is no perfect solution for the case of a video that plays on app startup. Even loading a h.264 will have a startup time, the hardware needs to buffer up the h.264 video the first time a video is played at app start time, and that takes time. Please seem my answer to how-to-correctly-preload-image-arrays-for-animation for some good info. But, the bottom line is that AVPlayer and all movie based approaches using the built in logic will not actually work for your needs. I have implemented a solution for this app boot problem using my AVAnimator library, you can find the xcode project for that at Fastest animation at app boot time. My solution is the fastest way to start animating, but it is only possible on the 2nd, 3rd, 4th time the app starts up. The very first boot still needs to decompress the image data from disk, so it has to wait for a moment in that case (it is not that big a deal and is only a short wait the first time the app is started). Still, this is typically faster than playing a h264 video, esp on older iOS hardware.

Community
  • 1
  • 1
MoDJ
  • 4,309
  • 2
  • 30
  • 65
0

Have you tried the AVQueuePlayer?

Bryce Kahle
  • 8,159
  • 1
  • 23
  • 26