I have working on set sprite/animated image on video but can't understand that how to do this. some one please help me to suggest how to set sprite image with video.
What you can do is convert your "gif" animation to a video, and then mix it with other videos like any other normal occasion.
Related
I want to play video (.mp4 format) in background continuously(on loop). I tried using the MediaPlayer,AVFoundation but i didn't get the desired result.
I used another method after converting mp4 to gif, .gif worked for me but the quality was low. So please help me find the best method to solve my problem.
For what purpose is this? If you're trying to have a video background for a login screen or something of that sort, its better to stick with lower res GIFs. It will save you memory, infact you can get really high quality GIFs from .mp4 files using photoshop but the resolution and frames will eat up iPhone's memory.
You can create AVPlayer object in AppDelegate.
Then register its "MovieFinished" observer. In that notification, you can restart the video playing.
Hope this helps.
I want to implement such a function that enable users to make GIF directly from their camera.
In detail, I want to show users a camera view, and a record button. When the button is tapped, the camera starts to record video. In fact, however, behind the scene the camera is actually taking photos at constant speed, say 1 shot per 0.5 second. When the record ends, we got an array of images and then connect them into a GIF.
I think there might be 2 approaches:
1、Directly taking images: Use AVCaptureStillImageOutput's -captureStillImageAsynchronouslyFromConnection method. But it will block UI every time it is called.
2、Take a video and extract several images from it. I have checked video taking libraries such as PBJVision and SCRecorder, and noticed that taking video is typically writing data to a mp4 file locally. I cannot figure out how to extract images at specific time intervals from a video file. Also, is there a way to store the video in memory?
Could anyone help?
Creating Gif
Create and and export an animated gif via iOS?
Convert Images to gif using ios
Extract Images from Video
Get a particular frame by time value using AVAssetReader
Similar here Creating a Movie from Images
How do I export UIImage array as a movie?
You can use a library called 'Regift' by Matthew Palmer, which will convert video to GIF.
Here it is: https://github.com/matthewpalmer/Regift
You can also check out the following answer here on SO:
https://stackoverflow.com/a/28150109/3288936
Hope this will help! :)
I have a video that I have already taken that I am looping in an AVPlayerLayer. I would like to know the best way to pass that video through a CIFilter for both live filtering and for saving the video with the filter applied. I have found Apple's CIFunHouse to be helpful, but it is for actually taking the video and processing each frame as it is taken where as I want to apply the filter after the video is taken. How could I go about doing this?
You can take a look at GPUImage: https://github.com/BradLarson/GPUImage
I have video in .mp4 format and I would like to get last frame of this video then blur it and put into UIImageView. My problem is that I dont know how to get last frame of video. How can I do this in iOS?
Use AVAssetImageGenerator.
https://developer.apple.com/librarY/mac/documentation/AVFoundation/Reference/AVAssetImageGenerator_Class/Reference/Reference.html#//apple_ref/occ/cl/AVAssetImageGenerator
I haven't personally used it, but it looks pretty straight forward if you've used AVFoundation before. Looks like you just initialize it with an asset and then you can generate a CGImage at a specific time using copyCGImageAtTime:actualTime:error:
You may try MPMoviePlayer, here is document related:
https://developer.apple.com/library/ios/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006953-CH3-SW69
i am able to show square preview of recording using AVCaptureVideoPreviewLayer class, But it saving video in rectangular in library. Instead of rectangle i want square video. I have used composition class to crop video and it is working but taking too much time. I check vine app which has square video output.
Please give me suggestion.
its late answer but it is used for another.. see the my ans
https://github.com/piemonte/PBJVision
record video in square