title: Access high fps camera on Android
body: <p>There are phones with official support for high fps recording, like the Galaxy S5 and S6. I tried both, with both you can record high fps videos (60 or even 120 fps) with the default camera app. (Or on the S6 using Gear VR's "Passthrough Camera" function.) BUT: when you query the camera's capabilities through the standard Android APIs (tried it on both S5 on 4.4 and 5.0 and S6 on 5.1, tried both the old and the new camera2 APIs) in all cases, 30 fps is reported as the highest available. Does this mean that these phones use private proprietary APIs to access high fps capabilities and there's no standard way to access higher fps? Is this the shortcoming of the manufacturer (which might change with future software versions or phones) or am I just missing something?
  I don't even need slow motion, just high frame rate camera for real-time usage, so 60 fps would be sufficient.</p>
  
  <p>Sample I tried for querying camera fps in the old camera API;</p>
  
  <pre><code>List&lt;Camera.Size&gt; a = camera.getParameters().getSupportedPreviewSizes();
  List&lt;int[]&gt; b = camera.getParameters().getSupportedPreviewFpsRange();
  int[] c = new int[2];
  camera.getParameters().getPreviewFpsRange(c);
  </code></pre>
  
  <p>Same in camera2 API:</p>
  
  <pre><code>CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);
  String[] cameras = manager.getCameraIdList();
  for(String camera : cameras) {
      CameraCharacteristics cc = manager.getCameraCharacteristics(camera);
      Range&lt;Integer&gt;[] fpsRange = cc.get(cc.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES);
  }
  </code></pre>
  
  <p>I only get ranges:
  [15, 15], [24, 24], [10, 30], [15, 30], [30, 30] (even less ranges with the old camera API).</p>
  
  <p>In camera2 API I found some methods for accessing high fps camera recording: <a href="http://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#createConstrainedHighSpeedCaptureSession(java.util.List%3Candroid.view.Surface%3E,%20android.hardware.camera2.CameraCaptureSession.StateCallback,%20android.os.Handler)" rel="noreferrer">createConstrainedHighSpeedCaptureSession()</a>.
  But it defines high speed video recording as "frame rate &gt;=120fps", so I shouldn't even need it for 60 fps. Anyway I queried this capability, but it seems it's not supported on the S6. The code I tried:</p>
  
  <pre><code>CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);
  String[] cameras = manager.getCameraIdList();
  for(String camera : cameras) {
      CameraCharacteristics cc = manager.getCameraCharacteristics(camera);
      CameraCharacteristics.Key&lt;int[]&gt; aa = cc.REQUEST_AVAILABLE_CAPABILITIES;
      for (int i = 0; i &lt; cc.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES).length; i++) {
              Log.e(TAG, "Capability: " + cc.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES)[i]);
      }
  }
  </code></pre>
  
  <p>It says it only support capabilities 0, 1, 2, 3, 5, 6.
  REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO would be 9.</p>
  
  <p>At this point I've pretty much ran out if ideas suspecting these capabilities truly aren't available through standard APIs on these phones. Any help is appreciated.</p>
  
  <p>I know the question is pretty similar/related to this: <a href="https://stackoverflow.com/questions/29070650/capture-high-fps-videos-using-new-camera-api">Capture high fps videos using new Camera API</a>
  But my question is more general, not specific to neither the old nor the new camera API, or specific devices. I'm also curious what supported fps other new flagship devices report through the standard APIs as I could only test it on 3 devices.</p>