I'm working on a project and one of the features is to play a video from a rtmp path. I'm trying to find the best way to draw the frames. Right now I'm using a UIImageView and works, but It's not very elegant nor efficient. OpenGL might do the trick but I've never used it before. Do you have some ideas what should I use? If you agree with OpenGL can you give me a code snippet that I could use for drawing the frames?
Thank you.
Related
I am writing an iOS app which is about live object detection. And I need to resize (scale)the video input and use the Metal framework afterwards. But I didn't find any Api provided by apple to do such thing.
I can crop it but scaling it seems harder.
Does anyone know how to do it?
I need to display a sequence procedurally generated images as video sequence preferably with built-in controls (controls would be nice to have, but no requirement) and I'm just looking for a bit of guidance of which API to use. There seem to be a number of options but I'm not sure which one is the best suited to my needs. GPUImage, Core Video, Core Animation, OpenGL ES or something else?
Targetting just iOS 6 and up would be no problem if that helps.
Update: I'd prefer something that would allow me to display the video frames directly rather than writing them to a temporary movie.
Checkout the animationImages property of UIImageView. This may do what you are looking for. Basically you would store all of your images into this array so it can handle the animation for you. UIImageView Reference
I'm planning on making a simple 2D game (I'm leaning towards an endless runner) for the iPhone and am using cocos2d and I can make stand alone images in Photoshop or Illustrator but I'm not sure what the best way to animate them is??
I don't know if I should animate a character running in flash then save each frame as a png and then use something like texture packer to make a sprite sheet or loop the png's together in cocos2d?? I don't know what works well with cocos2d and how to optimize the animation to run smoothly and reduce memory. I'm aware it maybe a broad question but any help or guidance would be appreciated.
You should use sprite sheet and animate the frames using cocos2d.
Here are the tutorials by Ray Wenderlich
Here is the official coco2d video tutorial and sample
Plenty of tutorials out there. Your question is probably going to be flagged and closed in the near future. Try googling your questions first next time.
I would like to know the best(high performance / FPS) way of doing sprite (frame) animations in a MonoTouch project.
I'm doing this very effectively in Android by decoding whole sprite image, clip it at desired sizes and display frames at desired pace.
So, what's the most effective way of doing this in Monotouch, in terms of FPS.
Thanks in advance.
Have you looked at using MonoGame?
The SpriteBatch class works well for us. It is OpenTK/OpenGL underneath, so you could repurpose it for your needs if you don't want to use full MonoGame.
It depends on what are the demands that you have for your sprites.
If your requirements fall in the scope of what CoreAnimation can do, you can just your image into a UIView and use CoreAnimation to animate the view.
If you need more control, MonoGame provides a more comprehensive set of primitives for dealing with sprites.
I'm looking to draw a custom shape (say, a solid rectangle) using openGL ES in an iOS game built upon the Cocos2d framework. In another StackOverflow question, I saw a suggestion to use [CCDirector sharedDirector].openGLView; however, I am unsure as to how to go about this. Perhaps someone can provide an example or point me to some sample code?
Thanks in advance!
There are two tutorials I can recommend for doing this, depending on what exactly you are trying to achieve.
Generating Textures using CCRenderTexture - here
Generating Textures using OpenGL - here