How to increase frame rate with Android CameraX ImageAnalysis?

后端 未结 3 476

I\'m investigating the new CameraX API, in relation to how viable it might be to switch over from our current Camera2 system.

In our Camera2 system, we use an OpenG

3条回答
  •  暖寄归人
    2021-01-05 15:36

    Alright, this was driving me crazy for hours.

    Expanding upon Ian's answer for the newest version of CameraX, you can now extend ImageAnalysis directly. See CameraX equivalent of Camera2's CaptureRequest

    So to get 60FPS, we can use this modified code (example in Java):

    ImageAnalysis.Builder builder = new ImageAnalysis.Builder();
    Camera2Interop.Extender ext = new Camera2Interop.Extender<>(builder);
    ext.setCaptureRequestOption(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_OFF);
    ext.setCaptureRequestOption(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, new Range(60, 60));
    ImageAnalysis imageAnalysis = builder.build();
    

提交回复
热议问题