To successfully initialize DeepAR in offscreen rendering mode, the initialization steps need to be done in the correct order.

Off-screen rendering Android

An example of off-screen rendering for Android can be found here. Steps to take to do off-screen rendering (see android API documentation):

  1. Create DeepAR object

  2. call void setLicenseKey(String key) to activate licence key

  3. call void initialize(Context context, AREventListener eventListener)

  4. call void changeLiveMode(boolean value); true if you want to do real time continuous processing, false otherwise.

  5. call void setOffscreenRendering(final int width, final int height, DeepARPixelFormat format)

  6. feed the frames through void receiveFrame(ByteBuffer data, int width, int height, int orientation, boolean mirror)

  7. rendered frames will be delivered through void frameAvailable(Image frame) of the AREventListener object.

Did this answer your question?