2014/08/27

Image process against iPhone video at 60FPS by GPU

I tried to process (for example apply filter etc) images which was got by iPhone’s video camera. The image is sent to GPU and processed continuously.
I ever made code to get one image from iPhone camera when one button was tapped, and I have to change code to do this process continuously.

As before, my code used CADisplayLink. It sometimes set a flag and the image is got when the flag is raised in the method :
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection

This code worked but the speed was not fast, about just 30FPS even in iPhone 5s. I thought CADisplayLink limited the speed, therefore I rewrote the code not to use it.
But the speed did not improved at all.

Image process without CADisplayLink

Next I found activeVideoMaxFrameDuration in AVCaptureDevice class, I set the value for 60FPS, but an error appeared. Available maximum value was 30FPS…

I wonder how to get images at 60FPS from iPhone camera.
Develop | Comments(2) | Trackback(0)
Comment
Comment is pending approval.
Comment is pending blog author's approval.
Comment is pending approval.
Comment is pending blog author's approval.

管理者のみに表示