Log in or register to post comments

Pause Vuforia to take a Screenshot on IOS

August 31, 2017 - 4:10pm #6

I would like to pause Vuforia to take a screenshot using the native camera on IOS. 

It's not possible to do this without stopping the camera used for Vuforia in Unity.

 

// stop vuforia

VuforiaBehaviour.Instance.enabled = false;

// start vuforia

VuforiaBehaviour.Instance.enabled = true;

OR

// stop vuforia

CameraDevice.Instance.Stop();

CameraDevice.Instance.Deinit();

// start vuforia

CameraDevice.Instance.Init(CameraDevice.CameraDirection.CAMERA_DEFAULT);

CameraDevice.Instance.Start();

Both above approaches work, but the App freezes for 2 seconds as the Camera is re-initialized. 

Is there an alternative approach that is faster? That is more PAUSE/RESTART than STOP/PLAY?

 

Thanks

 

Pause Vuforia to take a Screenshot on IOS

August 31, 2017 - 4:57pm #5

Hello emorling,

There is no way to pause the app in the way you are describing here.

However, Vuforia has a way to access the image of the camera through code and allow you to get a screenshot. This article describes using the Vuforia.Image class: https://library.vuforia.com/content/vuforia-library/en/articles/Solution/Working-with-the-Camera.html#How-To-Access-the-Camera-Image-in-Unity

This will provide you with a pixel array of the camera image. Below that section you will also find some documentation on how to get an OpenGL texture of the camera image.

I hope this helps resolve your issue!

Thanks,

-Vuforia Support


Pause Vuforia to take a Screenshot on IOS

September 1, 2017 - 12:59am #4

Thanks I will try this for a screenshot, but in another use case I need to record a video. 

 

Is there anything else that can be done to pause "the race" for the camera?

 

Thanks

Pause Vuforia to take a Screenshot on IOS

September 1, 2017 - 10:18am #3

Can you clarify what you mean by "the race" for the camera? If you need something else to access the camera before Vuforia is ready, I'd recommend delaying the initialization of Vuforia until you are ready to use it.

Thanks,

-Vuforia Support

Pause Vuforia to take a Screenshot on IOS

September 1, 2017 - 12:31pm #2

Sorry, by race I mean compete for the camera. 

The problem is I need a sequence like this:

1. Start Vuforia

2. Pause Vuforia, record a video

3. Continue Vuforia

Pause Vuforia to take a Screenshot on IOS

September 3, 2017 - 2:26am #1

I have been able to get an OpenGL texture of the camera image. 

 

However it is flipped vertically. Is this to be expected?

Log in or register to post comments