quattro_4 scribble

scribble 落書き (調べた事をただ落書きする)

NSScreencast Episode #98 Camera Capture

Camera Capture - NSScreencast

動画の録画

  • AVFoundation
    • @import AVFoundation;
  • @import is that you don't need to add the framework in the project settings, it's done automatically
  • viewDidLoad
    • AVCaptureSession
      • [self.session addInput:input];
      • [self.session addOutput:output];
      • [self.session startRunning];
    • AVCaptureDevice
    • AVCaptureDeviceInput
      • initWithDevice
    • AVCaptureVideoDataOutput
      • self.sampleQueue = dispatch_queue_create("VideoSampleQueue", DISPATCH_QUEUE_SERIAL);
      • [output setSampleBufferDelegate:self queue:self.sampleQueue];
  • AVCaptureDevice
    • frontCamera
      • for (AVCaptureDevice *device in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) {
      • if ([device position] == AVCaptureDevicePositionFront) {
      • [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
  • AVCaptureVideoDataOutputSampleBufferDelegate
    • didOutputSampleBuffer
      • CIImage
        • CVImageBufferRef cvImage = CMSampleBufferGetImageBuffer(sampleBuffer);
        • CIImage *ciImage = [CIImage imageWithCVPixelBuffer:cvImage];
        • [ciImage imageByApplyingTransform
      • performance
      • translation (ex. OpenGL)
    • didDropSampleBuffer
  • CMSampleBuffer
    • GetEncoded
    • GetDisplaySize
  • kCVPixelBufferPixelFormatTypeKey
    • BGRA, RGBA
  • AVCaptureVideoPreviewLayer
    • [self.view.layer addSublayer:self.previewLayer];
  • processing response speed are different
    • throughput, format , camera vs video
  • face detection, video gravity
  • video内で顔の動きに合わせてmustacheを顔の上に表示する
  • iCapps - We mobilize your business.

カメラのテストで作者が映し出されるんだけど風貌がかわいい