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
DeepARobject -
call
void setLicenseKey(String key)to activate licence key -
call
void initialize(Context context, AREventListener eventListener) -
call
void changeLiveMode(boolean value);trueif you want to do real-time continuous processing,falseotherwise -
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 theAREventListenerobject
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.