Capture video without displaying the actual video stream

So, I have an application that can now capture video from the front face camera of the iphone, and then do some processing on the video stream in real time. However, I am trying to make this process shaded in the background and put other controls on the screen. For example, let's say I would like to start the camera and process the image feed, but I want the user to see a black screen with some buttons on it. Any ideas on how to do this?

+4
source share
2 answers

Here is a sample code from an Apple document: http://developer.apple.com/library/ios/#samplecode/PhotoPicker/Introduction/Intro.html there is also a way to customize the camera interface.

+1
source

Just so that we understand the terminology β€œin the background” correctly, you mean starting the camera capture when your application is in the foreground but does not display the actual video channel. It is possible, but I would like to clarify that if you move the entire application in the background, you will not have access to the camera.

There are several ways to do this, but the one I spent most of all is capturing video frames (or photos) through the AV Foundation. Using AVCaptureDevice and AVCaptureSession, you can capture video frames and send them to the encoder for saving to disk or for processing using your own code. None of this requires the camera channel to be displayed on the screen, so you can use any interface you like and take this video or photograph without any on-screen instructions.

I would warn that you should clearly indicate to your users what you are doing so that you are not at risk of confidentiality. Apple does not kindly respond to those who do this (for a good reason).

I encapsulate a lot of this in an open source GPUImage framework for processing video and photos, so you can look at the code for the GPUImageVideoCamera Class to see how I configure the capture input. I transfer video frames to OpenGL ES for applying filters and other processing operations, but you can ignore this part if you just want to do your own encoding or processing.

+16
source

All Articles