Is there front facing camera support with ARKit?
Asked Answered
L

3

7

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

Lawful answered 12/10, 2017 at 14:4 Comment(0)
D
15

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.

Defecate answered 12/10, 2017 at 16:14 Comment(2)
is there any Sample code To Record your my ARSCNViewLawful
is there is any Sample Code to To Take Image of my ARSCNViewLawful
I
4

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.

Instil answered 12/10, 2017 at 14:11 Comment(1)
so i can track body also using front camera ?Comyns
R
0

If you want to access the UIKit or AVFoundation cameras, you still can, but separately from ARSCNView. E.g., I'm loading UIKit's UIImagePickerController from an IBAction and it is a little awkward to do so, but it works for my purposes (loading/creating image and video assets).

Rend answered 8/2, 2018 at 2:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.