Search Unity

  1. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

How to switch camera Back-to-Front option ?

Discussion in 'AR' started by DaronLin, Jan 16, 2018.

Thread Status:
Not open for further replies.
  1. DaronLin

    DaronLin

    Joined:
    Mar 10, 2016
    Posts:
    5
    Hi,Every one.I have some question.

    Because I want to switch from the back to the front camera at running iOS device.And then search review Unity document.I think I can to use WebCamTexture switch device camera, get new Camere pixels info.and reset YUV texture at UnityARVideo.

    But It is to my mind,Maybe have some option can use in ARKit API reference? I'd like to use it.

    Thanks!
     
  2. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    Front facing camera can only be used with ARKit if you have iPhone X, and only for the face tracking configuration. You can only have one configuration active at a time as well, so either front for face tracking or back for regular arkit apps.
     
  3. DaronLin

    DaronLin

    Joined:
    Mar 10, 2016
    Posts:
    5
    Thanks for the answer. Jimmya.
    By the way. The video demo is Animoji-like project by our team,and using Animator and Blend Shape on face tracking component.Model is Unity-Chan from Unity Japan.
    If it is possible give me some comment,please. Thanks. And enjoy it !

     
  4. hawken

    hawken

    Joined:
    Aug 22, 2013
    Posts:
    612
    is it possible to get anything from both cameras at the same time? I tried to get video from the portrait camera while running AR on the back facing camera, it could only bring in one frame then stopped.
     
    Dave92FD likes this.
  5. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    This is great! It's going on twitter!
     
  6. Stage64

    Stage64

    Joined:
    Jul 27, 2016
    Posts:
    9
    Hey, couple of months later.. Did anyone figure it out, using both cameras?
     
    brettmoody likes this.
  7. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    Asked and answered.
     
  8. michaelcolin

    michaelcolin

    Joined:
    Jun 12, 2018
    Posts:
    9
    Can I use two scenes, one with the front facing and one with the rear facing?

    I'm trying with the ARKit 1.5 sample scenes and it doesn't seem to work. First scene is the face mesh sample ( front ) , second scene is the sample mesh painter. ( rear )
     
  9. brettmoody

    brettmoody

    Joined:
    Jun 25, 2015
    Posts:
    8
    For the face mesh sample, you may need to enable facetracking in ARKit_Settings.

    Found the picture below on another thread:
     

    Attached Files:

  10. WangJiDong

    WangJiDong

    Joined:
    Oct 16, 2018
    Posts:
    1
    I also want to do this function, can you tell me how you did it?
     
  11. daviner

    daviner

    Joined:
    Feb 14, 2018
    Posts:
    10
    @jimmya has there been a update so the front camera can also be used for regular arkit tracking? specifically focusing on object recognition. I want to be able to flick front back to front camera no need for face tracking
     
    skoteskote likes this.
  12. tahafarooq

    tahafarooq

    Joined:
    Sep 18, 2015
    Posts:
    7
    I am changing the back camera to the front camera using the ARFoundation 4.0.2.

    There is an option to select either the "World" or the "User" camera. The changing camera works fine on an iPhone 11 and higher. I have not tested it on an iPhone X but it is not working on an iPhone 8.

    I have the Face tracking disabled, I am just changing the "World" camera to the "User" camera by following the samples of ARKit provided.

    This is the log that I see on Xcode:


    Using session configuration 0x1e74da940
    Requested Features: User Facing Camera
    Supported Features: (None)
    Requested features not satisfied: User Facing Camera
    UnityEngine.XR.ARSubsystems.XRSessionSubsystem:DebugPrintConfigurationChange(Configuration, Feature)
    UnityEngine.XR.ARSubsystems.XRSessionSubsystem:Update(XRSessionUpdateParams)
    UnityEngine.XR.ARFoundation.ARSession:Update()

    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    Can ARKit not flip the camera on an iPhone which does not have a TrueDepth front camera?
     
  13. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    306
    Hi everyone, this video describes how to check supported configurations per device which may be helpful. Going to close this thread since it's outdated. If you have additional questions, please start a new thread and the team will be happy to help. Cheers!
     
Thread Status:
Not open for further replies.
unityunity