device cameras, include the NSCameraUsageDescription key in your app’s Info.plist file. • If your app uses device microphones, include the NSMicrophoneUsageDescription key in your app’s Info.plist file. Verify and Request Authorization for Capture switch AVCaptureDevice.authorizationStatus(for: .video) { case .notDetermined: // The user has not yet been asked for camera access. AVCaptureDevice.requestAccess(for: .video) { granted in if granted { self.setupCaptureSession() } } … }
устройствами. • Экземпляр AVCaptureDevice (устройства ввода, такое как камера или микрофон) • Экземпляр AVCaptureInput (для настройки портов из устройств ввода) • Экземпляр AVCaptureOutput (для управления данными на выходе) • Экземпляр AVCaptureSession (координирует поток данных от входа к выходу) Для настройки AVCaptureSession нам понадобится:
AVCaptureMovieFileOutput to output to a movie file • AVCaptureVideoDataOutput if you want to process frames from the video being captured, for example, to create your own custom view layer • AVCaptureAudioDataOutput if you want to process the audio data being captured • AVCaptureStillImageOutput if you want to capture still images with accompanying metadata
A12 or later processor • An iPad Pro with an A12X or later processor • iOS 13 WWDC 2019 session 225: Advances in Camera Capture & Portrait Segmentation.