Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there front facing camera support with ARKit?

How can we access Front Facing Camera Images with ARCamera or ARSCNView and is it possible to record ARSCNView just like Camera Recording?

like image 357
Bharrath Avatar asked Oct 12 '17 14:10

Bharrath


2 Answers

Regarding the front-facing camera: in short, no.

ARKit offers two basic kinds of AR experience:

  • World Tracking (ARWorldTrackingConfiguration), using the back-facing camera, where a user looks "through" the device at an augmented view of the world around them. (There's also AROrientationTrackingConfiguration, which is a reduced quality version of world tracking, so it still uses only the back-facing camera.)

  • Face Tracking (ARFaceTrackingConfiguration), supported only with the front-facing TrueDepth camera on iPhone X, where the user sees an augmented view of theirself in the front-facing camera view. (As @TawaNicolas notes, Apple has sample code here... which, until iPhone X actually becomes available, you can read but not run.)

In addition to the hardware requirement, face tracking and world tracking are mostly orthogonal feature sets. So even though there's a way to use the front facing camera (on iPhone X only), it doesn't give you an experience equivalent to what you get with the back facing camera in ARKit.


Regarding video recording in the AR experience: you can use ReplayKit in an ARKit app same as in any other app.

If you want to record just the camera feed, there isn't a high level API for that, but in theory you might have some success feeding the pixel buffers you get in each ARFrame to AVAssetWriter.

like image 117
rickster Avatar answered Sep 30 '22 23:09

rickster


As far as I know, ARKit with Front Facing Camera is only supported for iPhone X.

Here's Apple's sample code regarding this topic.

like image 29
TawaNicolas Avatar answered Sep 30 '22 23:09

TawaNicolas