如何使用Android Camera2 API以固定的曝光时间录制60 fps视频 [英] How to use android camera2 api to record 60 fps video with fixed exposure time
问题描述
我想实现一个应用程序,以固定的曝光时间记录60 fps.作为设备,我有Google Pixel.由于其本机摄像头应用程序可以60 fps的速度运行,并且其硬件级别为LEVEL_3,因此我认为这不是问题,但我无法使其正常运行.使用getSupportedPreviewFpsRange()
(来自照相机api),我得到的范围是[15, 15], [24, 24], [7, 30], [30, 30]
;使用getHighSpeedVideoFpsRangesFor
(来自照相机2 api),我得到的范围是[30, 120], [120, 120], [30, 240], [240, 240], [240, 240]
.当我将[60, 60]
设置为CONTROL_AE_TARGET_FPS_RANGE
时,出现错误请求中的Fps范围[60,60]不是受支持的高速fps范围".
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".
自定义应用程序甚至可以录制60 fps视频吗?
Is it even possible for a custom app to record 60 fps video?
如果不是,那么120 fps的效果如何? (我的记录速度为120 fps,但是当我关闭CONTROL_AE_MODE
并手动设置SENSOR_EXPOSURE_TIME
和SENSOR_SENSITIVITY
时,帧速率再次降低到30 fps)
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)
推荐答案
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.
这篇关于如何使用Android Camera2 API以固定的曝光时间录制60 fps视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!