Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS extracting video frames as images [duplicate]

I'm using UIImagePicker to allow the user to create a video and then trim it. I need to split that video into multiple frames and let the user choose one of them.

In order to show the frames I likely must convert them to UIImage. How can I do this? I must use AVFoundation but I couldn't find a tutorial on how to get & convert the frames.

Should I do the image capture with AVFoundation too? If so do I have to implementing trimming myself?

like image 655
MB. Avatar asked Nov 28 '11 05:11

MB.


People also ask

How do I extract a frame from an iPhone video?

Just open the Camera Roll or Photos app on the device, find and play the video, then pause at the video frame which you like to grab and save as image file, finally press the home and sleep buttons simultaneously.

How do I extract one frame of a video every second seconds into a photo?

The trick is to simply change the frame rate of the output to whatever we want using the -r n option where n is the number of frames per second. 1 frame per second would be -r 1 , one frame every four seconds would be -r 0.25 , one frame every ten seconds would be -r 0.1 and so on.


1 Answers

I think the answer in this question is what you are looking for.

iPhone Read UIimage (frames) from video with AVFoundation.

There are 2 methods specified by the accepted answer. You can use either one according to your requirement.

like image 81
Robin Avatar answered Nov 15 '22 19:11

Robin