1

I have been writing an app using the Camera2 API to capture slow motion footage. I know that the Samsung Galaxy S9+ can record slow motion up to 960 fps and for this particular project I need to record 480 fps.

The problem I have is that map.getHighSpeedVideoFpsRangesFor() with 720p or 1080p returns a maximum range of [240, 240] and if I try to manually give the CaptureRequest.Builder a [480, 480] range, I get this exception:

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)

Is it not possible to record 480 FPS on this device via the API? Can I take another approach? or am I doing something wrong?

Joao Ventura
  • 65
  • 1
  • 11

2 Answers2

0

I think it's impossible, although Samsung Galaxy S9+ can record slow motion up to 960 fps. Only system apps can do that, not third party apps.

DatPX
  • 1
  • 1
0

Galaxy S9 can do [120, 120]. maybe also [240,240]. You have to use recording template to reach a stable frame rate. and if it is dark - the FPS will drop.

mCameraDevice2.createCaptureRequest(CameraDevice.TEMPLATE_RECORD)

It cannot reach more then that. even S20 & S21 can hardly support 240, trust me - I have tried. You can check my channel for screen recording examples. For example: https://youtu.be/ioCqSn1Qdqs

I have questioned this topic many times on Samsung support site - their official answer is - that they do not allow more then 30 FPS.

By the way - you need also to check if the mediarecorder support the fast/high speed profile otherwise it will not be able to record. check like that:

if (resolution == 720 && CamcorderProfile.hasProfile(camID, CamcorderProfile.QUALITY_HIGH_SPEED_720P))
                profile = CamcorderProfile.get(camID, CamcorderProfile.QUALITY_HIGH_SPEED_720P);
kfir
  • 635
  • 8
  • 27