Skip to main content

Offscreen Rendering Guide

A cheat-sheet for offscreen rendering on Android

To successfully initialize DeepAR in offscreen rendering mode, the initialization steps need to be completed 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):

  • Create DeepAR object

  • call void setLicenseKey(String key) to activate licence key

  • call void initialize(Context context, AREventListener eventListener)

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

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

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

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