我一直在写一个应用程序,使用Camera2 API来捕捉慢动作镜头。我知道三星Galaxy S9+可以录制高达960帧的慢动作,对于这个特定的项目,我需要录制480帧。
我遇到的问题是,map.getHighSpeedVideoFpsRangesFor()在使用720p或1080p时返回的最大范围是[240, 240],如果我试图手动给CaptureRequest.Builder一个[480, 480]的范围,我得到这个异常。
IllegalArgumentException while invoking public abstract void android.hardware.camera2.CameraCaptureSession$StateCallback.onConfigured(android.hardware.camera2.CameraCaptureSession)
java.lang.IllegalArgumentException: Fps range [480, 480] in the request is not a supported high speed fps range [[120, 120], [240, 240], [60, 120], [30, 120], [60, 240], [30, 240]]
at android.hardware.camera2.utils.SurfaceUtils.checkConstrainedHighSpeedSurfaces(SurfaceUtils.java:151)
at android.hardware.camera2.impl.CameraConstrainedHighSpeedCaptureSessionImpl.createHighSpeedRequestList(CameraConstrainedHighSpeedCaptureSessionImpl.java:83)
at ch.package.app.RecordActivity.updatePreview(RecordActivity.java:655)
at ch.package.app.RecordActivity.access$700(RecordActivity.java:74)
at ch.package.app.RecordActivity$3.onConfigured(RecordActivity.java:257)
at android.hardware.camera2.impl.CameraConstrainedHighSpeedCaptureSessionImpl$WrapperCallback.onConfigured(CameraConstrainedHighSpeedCaptureSessionImpl.java:398)
at java.lang.reflect.Method.invoke(Native Method)
at android.hardware.camera2.dispatch.InvokeDispatcher.dispatch(InvokeDispatcher.java:39)
at android.hardware.camera2.dispatch.HandlerDispatcher$1.run(HandlerDispatcher.java:65)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)
在这个设备上通过API记录480FPS是不可能的吗?我可以采取其他方法吗?或者我做错了什么?