NSScreencast Episode #98 Camera Capture
動画の録画
- AVFoundation
- @import AVFoundation;
@import
is that you don't need to add the framework in the project settings, it's done automatically- objective c - @import vs #import - iOS 7 - Stack Overflow
- #importと#includeの違いもある
- 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];
- AVCaptureSession
- AVCaptureDevice
- frontCamera
- for (AVCaptureDevice *device in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) {
- if ([device position] == AVCaptureDevicePositionFront) {
- [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
- frontCamera
- AVCaptureVideoDataOutputSampleBufferDelegate
- didOutputSampleBuffer
- CIImage
- CVImageBufferRef cvImage = CMSampleBufferGetImageBuffer(sampleBuffer);
- CIImage *ciImage = [CIImage imageWithCVPixelBuffer:cvImage];
- [ciImage imageByApplyingTransform
- performance
- translation (ex. OpenGL)
- CIImage
- didDropSampleBuffer
- didOutputSampleBuffer
- 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.
カメラのテストで作者が映し出されるんだけど風貌がかわいい