avcapturesession

Screen Capture including AVCaptureVideoPreviewLayer with overlay Buttons

喜你入骨 提交于 2019-12-10 11:48:36
问题 I am using screen Recorder to capute screen. It is perfectly working when a view was filled in iphone screen. when the AVCaptureVideoPreviewLayer was displayed with overlay buttons, then the saved screen captured video shows overlay buttons without AVCaptureVideoPreviewLayer . I have used this tutorial for adding overlays. How to fix this? 回答1: - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *

AVCaptureSession and AVAudioSession recording video while background music playing only works once

僤鯓⒐⒋嵵緔 提交于 2019-12-10 02:19:22
问题 After looking at this question: AVAudioSession AVAudioSessionCategoryPlayAndRecord glitch, i tried to take a stab at trying to get video recording with background music playing working correctly. I'm settling for the audio glitch when recording starts, and when it ends, and it works fine the first time the recording happens. But if I try to record again, the music will stop. Any ideas why? Here's a snippet of my code: captureSession = AVCaptureSession() captureSession?

AVCaptureSession and AVCaptureMovieFileOutput frame timestamp

天大地大妈咪最大 提交于 2019-12-10 01:34:04
问题 I am recording a movie with AVCaptureSession and AVCaptureMovieFileOutput. I am also recording acceleration data and trying to align the acceleration data with the video. I am trying to figure out a way to get the time the video file recording started. I am doing the following: currentDate = [NSDate date]; [output startRecordingToOutputFileURL:fileUrl recordingDelegate:self]; However, according to my tests, the video recording starts 0.12 seconds before the call to

AVCaptureSession for audio in simulator

空扰寡人 提交于 2019-12-09 17:16:09
问题 I'm trying to capture audio, using the method in this question; with AVCaptureSession and AVCaptureAudioDataOutput. This seems to work fine with 1 inconvenience: it doesn't work in the simulator. Both AVAudioRecorder, and the good old SpeakHere demo app, work fine in the simulator, using the internal microphone on my MacBook Pro. Problem is that [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio] gives null in the simulator, so subsequent code fails with the message (when it tries

Play system sound while recording video/audio

狂风中的少年 提交于 2019-12-09 13:28:03
问题 I'm trying to play a "beep" sound as required by apple when I start recording a video. I've found through SO and other sources that you can't play a sound while you have an audio input going without some configuration. Here's my attempt at the configuration method: private void SetupAudio() { beepSound = AssetBank.GetSystemSoundWav("video_record", "video_beep"); AudioSession.Initialize(); AudioSession.Interrupted += delegate { Console.WriteLine("Interrupted handler"); }; AudioSession.Category

Real time face detection with Camera on swift 3

那年仲夏 提交于 2019-12-09 07:19:44
问题 How can I do face detection in realtime just as "Camera" does? like white round shape around and over the face. I use AVCapturSession . I found that the image I saved for facial detection. Below I have attached my current code. it only captures image when I press the button and save it into the photo gallery. some please help me to create real-time round shape over according to the person's face! code class CameraFaceRecongnitionVC: UIViewController { @IBOutlet weak var imgOverlay:

Hold multiple Frames in Memory before sending them to AVAssetWriter

好久不见. 提交于 2019-12-09 06:22:27
问题 I need to hold some video frames from a captureSession in memory and write them to a file when 'something' happens. Similar to this solution, i use this code to put a frame into a NSMutableArray: - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection*)connection { //... CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); uint8 *baseAddress = (uint8*)CVPixelBufferGetBaseAddress

AVCaptureSession stopRunning method creates terrible hang

走远了吗. 提交于 2019-12-08 23:09:56
问题 Using Ray Wenderlich's QRCode reader from Chapter 22 of iOS7 Tutorials, I am successfully reading QRCodes for my current app. I am now extending it that upon successfully reading a QRCode, I want to store the stringValue of the AVMetadataMachineReadableCodeObject that was read, segue to a new view, and use that data on the new view, more or less exactly how most QRCode reader apps (like RedLaser, etc...) process barcodes and QRCodes. However, I call [captureSession stopRunning] (so that it

Applying Effect to iPhone Camera Preview “Video” Using OpenGL

风格不统一 提交于 2019-12-08 06:09:25
问题 My goal is to write a custom camera view controller that: Can take photos in all four interface orientations with both the back and, when available, front camera. Properly rotates and scales the preview "video" as well as the full resolution photo. Allows a (simple) effect to be applied to BOTH the preview "video" and full resolution photo. My previous effort is documented in this question. My latest attempt was to modify Apple's sample GLVideoFrame (from WWDC 2010). However, I have not been

IOS Toggle AVFoundation Camera

荒凉一梦 提交于 2019-12-07 21:10:00
问题 In my App I'm capturing images using AVFoundation I made a button to switch between front and back cameras but it won't work. Here's the code I used : if (captureDevice.position == AVCaptureDevicePositionFront) { for ( AVCaptureDevice *device in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo] ) { if ( device.position == AVCaptureDevicePositionBack) { NSError * error; AVCaptureDeviceInput * newDeviceInput = [[AVCaptureDeviceInput alloc]initWithDevice:device error:&error];