avcapture

Proper way to optimize my AVCaptureSession?

霸气de小男生 提交于 2020-01-01 03:44:07
问题 I got my AVCaptureSession to work and it duplicates the Camera.app UI almost perfectly, however, after a few seconds the application will crash and I just cannot find what I'm doing wrong. I really hope someone knows how to optimize this! I AM using ARC; and again, the whole session runs fine but crashes after a little bit. The AVCaptureSession delegate method gets called what seems like EVERY second. If there's a way to call that method only when the user presses the "take picture" button,

how to draw grid lines when camera is open avcapturemanager [closed]

寵の児 提交于 2019-12-31 10:45:12
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I want to display grid line like the one which appears when a camera is open.I am using AVCaptureManager.Should i use core graphics to draw grid lines?what is the size of those grid lines? thanks 回答1: You can indeed add a custom view as an overlay over your camera view to draw the grid using QuartzCore. That is

How do i save a video (mp4 format) using AVCaptureVideoDataOutput?

烈酒焚心 提交于 2019-12-21 18:40:09
问题 I have set up the input, and the output for the AVCapture session and also the delegate - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection is getting called. How do I convert the frames to a mp4 video file and save it? 回答1: Use an AVAssetWriter to compress the data and write to MP4. These two samples contain code that does this: http://www.gdcl.co.uk/2013/02/20/iPhone-Pause.html http:/

AVCapture appendSampleBuffer

半世苍凉 提交于 2019-12-20 09:24:41
问题 I am going insane with this one - have looked everywhere and tried anything and everything I can thinks of. Am making an iPhone app that uses AVFoundation - specifically AVCapture to capture video using the iPhone camera. I need to have a custom image that is overlayed on the video feed included in the recording. So far I have the AVCapture session set up, can display the feed, access the frame, save it as a UIImage and marge the overlay Image onto it. Then convert this new UIImage into a

How do I record a video on iOS without using a preset?

大憨熊 提交于 2019-12-20 01:39:46
问题 The simpler way to record a video on iOS is by setting a AVCaptureSession.sessionPreset. But that doesn't work for me since I want to control parameters like binning, stabilization (cinematic, standard, or none) and ISO. I find the format I want and assign it to activeFormat, but when I try to start recording, I get an error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureMovieFileOutput startRecordingToOutputFileURL:recordingDelegate:] No

Capture Metal MTKView as Movie in realtime?

时光总嘲笑我的痴心妄想 提交于 2019-12-18 02:48:27
问题 What is the most efficient way to capture frames from a MTKView ? If possible, I would like to save a .mov file from the frames in realtime. Is it possible to render into an AVPlayer frame or something? It is currently drawing with this code (based on @warrenm PerformanceShaders project): func draw(in view: MTKView) { _ = inflightSemaphore.wait(timeout: DispatchTime.distantFuture) updateBuffers() let commandBuffer = commandQueue.makeCommandBuffer() commandBuffer.addCompletedHandler{ [weak

AVCaptureSession specify resolution and quality of captured images obj-c iphone app

蹲街弑〆低调 提交于 2019-12-17 15:52:08
问题 Hi I want to setup AV capture session to capture images with specific resolution (and, if possible, with specific quality) using iphone camera. here's setupping AV session code // Create and configure a capture session and start it running - (void)setupCaptureSession { NSError *error = nil; // Create the session self.captureSession = [[AVCaptureSession alloc] init]; // Configure the session to produce lower resolution video frames, if your // processing algorithm can cope. We'll specify

AVCaptureSession specify resolution and quality of captured images obj-c iphone app

China☆狼群 提交于 2019-12-17 15:51:34
问题 Hi I want to setup AV capture session to capture images with specific resolution (and, if possible, with specific quality) using iphone camera. here's setupping AV session code // Create and configure a capture session and start it running - (void)setupCaptureSession { NSError *error = nil; // Create the session self.captureSession = [[AVCaptureSession alloc] init]; // Configure the session to produce lower resolution video frames, if your // processing algorithm can cope. We'll specify

Change iPhone Camera Shutter Sound in App

这一生的挚爱 提交于 2019-12-13 18:14:38
问题 How can I change the sound that plays when an image is captured with an iPhone? I am using AVCapture and I want to capture still images (rather than grabbing frames from video) for image quality sake. Thanks in advance! 回答1: After researching it appears that the standard camera shutter sound is next to impossible to change via SDK. This answer supports that. You can replace your own sound, but not in an app. As for AVCapture, it also appears that you can't change the shutter sound as

AVCaptureStillImageOutput & UIImagePNGRepresentation

北城余情 提交于 2019-12-13 07:07:56
问题 I am having a hard time for something I think shouldn’t be so difficult, so I presume I must be looking at the problem from the wrong angle. In order to understand how AVCaptureStillImageOutput and the camera work I made a tiny app. This app is able to take a picture and save it as a PNG file (I do not want JPEG). The next time the app is launched, it checks if a file is present and if it is, the image stored inside the file is used as the background view of the app. The idea is rather simple