Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

The iPhone 5S is capable of taking pictures while recording video and I am trying to figure out how I would do this programatically. I know I would be utilizing AVFoundation, however, I couldn't find anything in the programming guide regarding this. I have also checked the sample projects (AVFoundation-related) and it doesn't look like there is anything there that does what I am looking for. if you could help point me in the right direction that would be great.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
616 views
Welcome To Ask or Share your Answers For Others

1 Answer

Actually you can do it with any device that can record video:

  • Create and configure a AVCaptureVideoDataOutput.
  • Add it to your AVCaptureSession.
  • Add a AVCaptureVideoDataOutputSampleBufferDelegate.
  • Implement captureOutput:didOutputSampleBuffer:fromConnection: in the delegate and get the image with imageFromSampleBuffer:.

Some similar code can be found here, where images are captured at a given interval, but you only want one image.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...