问题描述
我想实现一个应用,以固定曝光时间录制 60 fps.作为设备,我有 Google Pixel.由于它的原生相机应用程序可以达到 60 fps 并且它具有硬件级别 LEVEL_3,我认为这不会是一个问题,但我无法让它工作.使用 getSupportedPreviewFpsRange()
(来自相机 api)我得到范围 [15, 15], [24, 24], [7, 30], [30, 30]
和使用 getHighSpeedVideoFpsRangesFor
(来自 camera2 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 帧)
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)
推荐答案
Pixel 上的 60fps 记录可以在正常捕获设置下完成 - 看看 CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,然后创建一个正常的捕获会话.如果我没记错的话,你必须小心,不要设置太高的分辨率作为输出,因为 60fps 不能在 1080p 以上完成.
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.
您可以通过 StreamConfigurationMap 用于您打算使用的尺寸/格式.
You can confirm that via the StreamConfigurationMap for the sizes/formats that you're aiming to use.
这篇关于如何使用 android camera2 api 以固定曝光时间录制 60 fps 视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!