Search code examples
androidcameraopengl-es-2.0video-captureaugmented-reality

Render camera in high resolution, with lower quality of image in onPreviewFrame


I have a closed source library for AR, and i must call method from this library with width, height and byte[] parameters(in onPreviewFrame callback). I render preview with opengles 2.0 and SurfaceTexture. I wish to render in higher resolution and transmit data to library in lower resolution. Is it possible?


Solution

  • No it isn't. Most image processing libraries know how to downscale their input. If yours is not the case, you should resample the byte[] in your onPreviewFrame() callback for it. Note that often AR processes only need grayscale, and thus you can save 33% of CPU cycles of downscaling.