Fotoapparat icon indicating copy to clipboard operation
Fotoapparat copied to clipboard

Low Frame Rate for both CameraView preview and Frame Processing

Open jeffreyfjohnson opened this issue 4 years ago • 0 comments

What are you trying to achieve or the steps to reproduce?

On my Moto G7, as well as other Android devices that I've tested, Fotoapparat has a low frame rate, as evidenced by two things. The CameraView that previews the frames the camera is capturing is choppy, and a println that I added in my FrameProcessor shows the callback is only invoked 2-4 times every second.

By contrast, I did a quick implementation using the Android CameraX framework, and the camera preview was very smooth, and the equivalent of the frame processor was getting 20-30 callbacks per second. Same exact device, same exact use case.

How did you initialize FA?

 private val camera = Fotoapparat(
        context = context,
        view = cameraView,
        lensPosition = back(),
        scaleType = ScaleType.CenterInside,
        cameraConfiguration = CameraConfiguration(frameProcessor = frameProcessor),
        cameraErrorCallback = { error ->
            logError("Camera error", error)
        }
    )

Are there any knobs I can tweak in order to get better performance out of Fotoapparat. It is clear that my device is capable of better performance, it can get that out of the CameraX framework.

Context:

  • FA version: 2.7.0
  • Devices/APIs affected: Any that I have tried

jeffreyfjohnson avatar Jun 05 '20 17:06 jeffreyfjohnson