Search code examples
androidcamerapreviewcamera2highspeed

60/120fps preview data on an Android device?


We would like to process 120 fps (or 60fps) camera preview data using Neon assembly or GPU shaders to perform a simple image processing operation (eg 3x3 convolution). We are NOT interested in displaying the image on the screen so the camera data should go directly to a SurfaceTexture.

We thought we could do this using Camera2 API on a Nexus 5 using CameraConstrainedHighSpeedCaptureSession but have been unsuccessful.

There is no currently functional code on the internet (at least the part we have scraped) that allows this and yet it seems probable that the functionality exists.

The best example of using the Camera2 API for highspeed recording is here: https://github.com/PkmX/lcamera

In order to try to encourage someone to post a solution I am putting a bounty on this question.


Solution

  • We succesfully modified the camera2video sample to obtain 120 fps data rate on a Samsung S6.

    The code is here.

    We have not yet managed to extract the pixels but will update here when we do.