Monday, June 3, 2013

iPhone app: real time video sharing

An native iPhone app prototype that steams camera video between two iPhones. Not very complex, but it took a good amount of research and learning. Major classes are NSOperation, AVFoundation and GameKit.
  • Multi-threading is necessary to prevent UI lockup, so NSOperation is used. 
  • AVFoundation - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer (CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection is the key element to capture video frames from camera. 
  • GameKit peer-to-peer communication via Bluetooth is used to send and receive data between two devices. 
Result was that I was able to reach about 4 frames per second. Did not get to try Game Center peer-to-peer via local WiFi. I believe that will increase the frame rate.

No comments: