Skip to main content

Offscreen Rendering Guide

Follow this guide to enable DeepAR Android SDK to produce frames in pixel buffer format. These frames can be used, among other use-cases, as an input for video-calling and streaming APIs.

Off-screen rendering Android

  • 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

note

Some streaming APIs like Amazon IVS don't take in the pixel buffer frames, but rather provide a surface onto which the frames need to be rendered. Use void setRenderSurface(surface, width, height) for rendering onto a surface with DeepAR.