How would I go about encoding a video from an array of images like a time-lapse? - arrays

So I have been trying to do this for ages with no luck, ive found some solutions on git hub but these arent working for me, basically I have an array of UIImage which I want to be converted into a 10 second long video when the user presses a button, this video will then be saved to the users camera roll, does anyone have any code to deal with this in swift?
EDIT: The question which this has been marked as a duplicate from is answered in objective c, not swift

Related

Scanning through camera against a bank of 10 images

I building an app that can use an iPad camera to scan for particular images. There will be a bank of 10 images that will be matched against, and when there is a match on one I need to navigate the app to a specific screen.
I guess you can compare this to a QR scanner, but without QR codes.
Example of one of the images to scan is:
https://imgur.com/a/lhWv8ny
Trouble is, I'm struggling to come up with a solution to scan the images. The other parts, no issue.
I've tried pattern markers with a-frame, I've done a load of research but can't find anything concrete at the moment.
Any direction will greatly be appreciated.
Maybe try to import some machine-learning library and if it's text only extract the text and match it to a dictionary:
https://github.com/zsajjad/react-native-text-detector
Or you could match for similar images with opencv:
Checking images for similarity with OpenCV
https://github.com/brainhubeu/react-native-opencv-tutorial

videoangular--How to have multiple video players in one screen?

Hi so Im using this angularjs framework "videogular" and have no problem creating a single player, but I dont know how to create multiple players in one screen since apparently each player requires a controller
sample code here:
http://codepen.io/2fdevs/pen/KmDIE
Each player needs a different config file but not a different controller.
Maybe this other answer could be useful:
stop other video that is playing in background on play the new one

ActionScript 3 Game - Matching questions and answers

I am very new to flash and action script and I am making a matching game as part of a project. Basically you just match the animal print that is displayed with the corresponding animal and a score is added up ..
I have created the animal prints in photoshop, and I have them in a separate folder, I now need to display the random images with corresponding answers to this image.
I know this is a broad question and any help that is given will be greatly appreciated. The only action script I have so far is making the button click and link to the next page..
Heres the code..
import flash.events.MouseEvent;
stop()
gobutton.addEventListener(MouseEvent.CLICK, startgame);
function startgame (event:MouseEvent):void {
gotoAndStop(2)
}

android quiz application implementation

iam currently working on an android general quiz application,the application has three categories of questions physics,chemistry and maths.
These topics are also further divided into several sub topics(displayed in a listview), like physics is again divided into topics like geophysics,astrophysics, solid state physics etc.
Each topics gives questions related to that topic.
On clicking on any topic gets you to a screen which has a grid view with question numbers and questions you have answered in dark blue colour and not answered in light blue colour.On clicking the grid element you can directly move on to the specified question.The question has answers as multiple choices.The user need to choose any of it and it will indicate whether it is right or wrong.(and also mark that question as attended).
But iam having doubts on certain areas of code:
1) How to save the questions,options...?(if it has to be done by using files please provide me some sample codes thankyou)
2) Sometimes the questions and options show up some images how to handle this..?(this only happens in some cases so that all the other times the image has to be set null)
3) How can I access questions ,options from the file in which it has been saved.(I need also display the images if any present .
Please do reply

How to download images from array to tableviewcontroller in swift?

I have a table view controller with a cell that contains an UIImageView. I also have a NSMutableArray that contains the url's. I want the url's to download the images and place them in the correct order. The NSMutableArray also contains some empty Strings and the cell that it corresponds too I want to have my placeholder image from my image assets.
How can I get it to work? I have also populated each cell with a title and summary but cannot workout how images work.
UPDATE
The code used for the image download. Note the photoLabels contains the array of images. Some of the photos are in the incorrect place once the first placeholder image occurs (It is one index late). Why is it doing that. Does anyone know why. I have println(photoLabels) and all the 50 strings are correct (with some just being "")
If anyone can help that would be great.
let imageURL: String = photoLabels.objectAtIndex(indexPath.row) as String
println(imageURL)
if imageURL == "" {
cell.imageContainer.image = UIImage(named: "placeholder")
} else {
cell.imageContainer.setImageWithURL(NSURL(string: imageURL))
}
return cell
Thanks
This seemingly innocent question actually entails a rat's nest of interesting details. These include:
Use lazy loading of the image, loading them just-in-time, rather than trying to download them up front;
Download the images asynchronously;
While downloading the images as needed, cache them (using NSCache, not NSMutableArray) so that if you scroll back to see some images recently downloaded that you don't have to download them again;
But, in response to memory pressure, make sure to empty the RAM-based cache (but still avail yourself of the persistent storage cache);
If user scrolls quickly down to the 100th row in the table example, make sure that the images for the visible cells don't get backlogged behind the requests for the previous 99 images (nb: you should test your app in suboptimal conditions, e.g. a poor 2G or 3G cellular environment, which can be simulated with the network link conditioner); and
You might want a placeholder image to show until the asynchronously retrieved image is downloaded (or retrieved from the cache).
The bottom line is that this takes a non-trivial amount of effort to do properly. As a result, I'd encourage you to use an existing solution, for example the UIImageView categories that are available from SDWebImage or AFNetworking. Both of these two frameworks offer a nice category for UIImageView that allows you to request the image to be downloaded asynchronously (it's sd_setImageWithURL in SDWebImage; it's setImageWithURL in AFNetworking).

Resources