3

I want to implement a app to record 60 fps with fixed exposure time. As device I have the Google Pixel. Since its native camera app can do 60 fps and it has hardware level LEVEL_3, I thought this won't be a problem but I can't get it working. With getSupportedPreviewFpsRange() (from camera api) I get ranges [15, 15], [24, 24], [7, 30], [30, 30] and with getHighSpeedVideoFpsRangesFor (from camera2 api) I get ranges [30, 120], [120, 120], [30, 240], [240, 240], [240, 240]. When I set [60, 60] to CONTROL_AE_TARGET_FPS_RANGE I get error "Fps range [60, 60] in the request is not a supported high speed fps range".

Is it even possible for a custom app to record 60 fps video?

If not, how is it by 120 fps? (I have got 120 fps recording working, but when I set CONTROL_AE_MODE off and manually set the SENSOR_EXPOSURE_TIME and SENSOR_SENSITIVITY, the frame rate again reduces to 30 fps)

Jian
  • 63
  • 1
  • 2
  • 8

1 Answers1

3

60fps recording on Pixel can be done in normal capture settings - take a look at CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, and just create a normal capture session. You will have to be careful and not set up too high of a resolution as your outputs, since 60fps can't be done at above 1080p, if I remember correctly.

You can confirm that via the StreamConfigurationMap for the sizes/formats that you're aiming to use.

Eddy Talvala
  • 17,243
  • 2
  • 42
  • 47
  • thx Eddy, I have successfully achieve 60 fps by video recording and even by YUV capturing (with resolution 1920x1080). That's was a surprise with YUV, because I've checked the minal frame duration for YUV_420_88 both for biggest size (4048x3036) and smallest size (160x120) and they were 33333333 ns. But for size (1920x1080) it's indeed 16666666 ns. But when I set the exposure time and ios value manually with `CONTROL_AE_MODE` and `CONTROL_MODE`set to off, the frame rate drops again to 30 fps: Have I done something wrong? Or works 60fps only with auto exposure? – Jian May 02 '17 at 14:45
  • Did you set the frame duration (https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.html#SENSOR_FRAME_DURATION )? That's the third manual control; you need to set that to 60fps on your own. The default is likely 1/30s, not 1/60s. – Eddy Talvala May 02 '17 at 23:47
  • yes I've set the `SENSOR_FRAME_DURATION` to 16666666, which is the exactly value I got from `getOutputMinFrameDuration(ImageFormat.YUV_420_888, new Size (1920, 1080))'. I did the steps that you've described here [stackoverflow.com/questions/28293078/how-to-control-iso-manually-in-camera2-android](http://stackoverflow.com/questions/28293078/how-to-control-iso-manually-in-camera2-android) both for preview session and capture session, they both dropped to 30 fps. – Jian May 03 '17 at 06:52
  • Also in the onCaptureCompleted Callback I printed out the Metainfo of CaptureRequest and TotalCaptureResult, I got the following: `request exposure time = 10000000 request iso = 120 reqeust frame duration = 16666668 result exposure time = 9996276 result iso = 120 result frame duration = 33329874` When I set the frame duration longer than 33333333 (1/30fps), e.g. 40000000, it works. But it doesn't work for duration shorter than 1/30. Am I doing something wrong? – Jian May 04 '17 at 09:05
  • That unfortunately sounds like a device bug. If this is on Pixel, you could open a bug at https://issuetracker.google.com/issues/new?component=190923&template=841312 – Eddy Talvala May 08 '17 at 18:15
  • 1
    @EddyTalvala Well here we are 3 years later and I'm running into this exact same issue on my Pixel XL. I can get 60FPS working with auto mode, but in manual mode it just doesn't go higher than 30. I can adjust the frame duration to get lower than 30FPS, (e.g. 24), but it refuses to go any higher than 30. Any ideas, now that 3 years has elapsed? Do you still think it's a bug? – You'reAGitForNotUsingGit Mar 20 '20 at 03:55
  • @EddyTalvala how can we check if a specific fps range is supported for a specific resolution? – user924 Apr 12 '22 at 14:44
  • You can see if that specific resolution/output destination lists a https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap?hl=en#getOutputMinFrameDuration(java.lang.Class%3CT%3E,%20android.util.Size) that's less than or equal to 1/max fps for the range you care about. So if getOutputMinFrameDuration returns 33ms, then all ranges that have a max FPS <= 30 should work. There's no need to check the min FPS, since it's easy to run slower so that's not a limit. – Eddy Talvala Apr 14 '22 at 01:18
  • @EddyTalvala I didn't notice that devices can return values higher than 30 for `CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES`, so it's always 30 maximum – user924 Feb 28 '23 at 13:44