tezvyn:

Apply a CIFilter to a live camera feed

Source: interviewadvanced

WHAT IT TESTS: Capturing raw frames and the queue discipline. OUTLINE: Use AVCaptureSession with AVCaptureVideoDataOutput, receive CMSampleBuffers in captureOutput via the sample buffer delegate on a serial queue, filter with CIImage, drop late frames.

WHAT IT TESTS: Whether you understand the capture pipeline and real-time queue constraints. ANSWER OUTLINE: Build an AVCaptureSession with a camera AVCaptureDeviceInput and an AVCaptureVideoDataOutput. Set a sample buffer delegate with setSampleBufferDelegate(_:queue:) on a dedicated serial queue, never the main queue. Frames arrive in captureOutput(_:didOutput:from:) as CMSampleBuffer; convert to CIImage, apply the CIFilter, render. Enable alwaysDiscardsLateVideoFrames so slow processing drops frames instead of backing up.

Read the original → interview

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Apply a CIFilter to a live camera feed · Tezvyn