How do i animate with a big sprite in ios? - ios

I have to make an animated infographic in iOS. Its consists of about 140 images all 900x700 large. Whats the best approach to do this? I tried CALayerwith indivual images, and also a spritesheet. But it just takes way too long to load and the playback is awful. I also have the animation in a video file, but it needs to be added to a view in a set frame and not be played in full screen.

Try and play the animation video using MPMoviePlayerController. You can play it in a view with custom frame. You can refer the link for sample code too.

Related

How to add text label on the the video frame by frame - iOS swift

I am doing video editing app. I have one animation video and I am using AVPlayer to play the video. So i need to add some label text on the video frame by frame.
Is it possible to add overlay label text on the video frame by frame?
Yes it is possible, you will have to use AVFoundation to do this. However is can be complex with no previous knowledge of AVFoundation. The best thing I can do is to give you this tutorial and then this one (which is what you want to do but written in Objective-C). These tutorials will explain to you the basics of how the framework works. You can also check the Apple videos about the framework.

Auto video in iphone?

Anyone know how to add the auto playing video background in iOS? I am guessing its actually images? But the video lasts for 15 seconds so if its images then at 24fps minimum that is a lot of images.
I tried using the UIImageView swapping of images, but it seems like a hack way to do this.
See Uber's app and I think Airbnb has it also.
You can make them images as you guessed, or play video using either MPMoviePlayerController or AvPlayer. Just add any as a subview to your view and make it play at viewWillAppear. I used AvPlayer as the app home screen background before and it worked perfectly.

iOS placing and synchronizing frame by frame images over a video playing with AVPlayer

I'm trying to place an image over a video that is playing. There could be a face in the video and I want to plae a custom image over that face. I've tried to play the video using AVPlayer and tried to place the custom image using a scheduled NSTimer. It works good (not perfect) with the simulator. But When I tried it in couple of different devices it does not working well or same in all the devices. Seems like there should be some sort of synchronization to sync the video frame and the custom image.
Can anyone help me out of this issue with any tips or suggestion? Anything that is helpful will be appreciated. :)
Thanks in advance.

Play M4V in background IOS

I'm trying to figure out if it's possible to play an m4v file in the background with buttons that overlay ontop of the video? The video is basically an animation (no sound) but I need to be able to add additional navigation on top of the animation to bring in other calls in the app.
Is that possible to do? If so what is the call that would be required? I've tried hunting around but can't find an answer yet
You can use MPMoviePlayerController, set control style to none, and put your own buttons on top of it.
http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMoviePlayerController_Class/Reference/Reference.html

iOS SDK AVFoundation ... How do I compose a video asset with a drawing asset

What I have achieved so far:
Using AVFoundation services, I have placed a video in a UIView that a user can play, pause, etc (using AVPlayer, AVPlayerItem, AVPlayerLayer, etc)
I have placed a UIView (with transparent/clear background color) on top of the view that is supposed to show the playing video. I have also handled UIKit touch events to draw lines based on user interaction.
Now when I play the video and touch the UIView which is overlayed on that view, I can see lines drawn on the playing video.
What I want to do:
After the user is done with the drawing (which he thinks is overlayed on the video), I want my app to compose the original video and what the user interaction (lines being drawn, removed, etc) and export the result as another video file.
Any help or sample code will be highly appreciated.
For compositing the content together, have a look at AVVideoCompositionCoreAnimationTool. It lets you add animations to a movie using CALayer objects.
For exporting, once you have your composition built and the CALayers rendering together, you can pass it straight to an AVAssetExportSession which will write it out to a video file.

Resources