Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to record video of front and back camera at a time in iOS

Tags:

ios

swift

camera

How to record video with both front and back camera at a time in iOS with swift. That is while recording video from iPhone with front camera I want to open back camera and record video. That means finally in one video file I just want to cover both sides

like image 954
rani Avatar asked Jul 23 '15 11:07

rani


People also ask

How do you record a video with both front and back cameras on iPhone?

You can see the feed from all the cameras present on your iPhone. Just select any two cameras, which you want to record with, in this case the front and back camera, and just hit the record button, it's that simple. Another benefit of the app is that you can also record footage from the different cameras on the back.


4 Answers

With iOS 13, it is now possible to simultaneously capture video natively on both front and back cameras on an iPhone with the A12 chip or later, or an iPad with the A12X chip or later.

Check out the new AVCaptureMultiCamSession class.

AVCaptureMultiCamSession

A capture session that supports simultaneous capture from multiple inputs of the same media type.


Your question is a little unclear though. If instead of simultaneously recording both cameras, you're looking to switch between cameras during the recording, you can utilise this functionality and "merge" the shots at the timestamp where the user switches between the front and back cameras. On older devices, the only way to do that is to stop and restart the recording in a different camera.

like image 96
LWJ Avatar answered Oct 12 '22 17:10

LWJ


According to AVFoundation Programming Guide provided by Apple:

Media capture does not support simultaneous capture of both the front-facing and back-facing cameras on iOS devices.

like image 28
ABHILASH P Avatar answered Oct 12 '22 18:10

ABHILASH P


I don't think it's could record both camera at one time in IOS. You could check AVCaptureDeviceInput class.

This is how I catch the video from session queue

AVCaptureDevice *videoDevice = [iSKITACamViewController deviceWithMediaType:AVMediaTypeVideo preferringPosition:preferredPosition];

AVCaptureDeviceInput *videoDeviceInput = [AVCaptureDeviceInput 
deviceInputWithDevice:videoDevice error:nil];

[[self session] beginConfiguration];
like image 4
Alex Cheng Avatar answered Oct 12 '22 18:10

Alex Cheng


I think you can not access both cameras at a time, means if you are recording with the front camera you don't access the back camera and vice versa. You can check this link.

like image 2
Paddy Avatar answered Oct 12 '22 17:10

Paddy