简体   繁体   中英

How to get raw preview data from Camera object at least 33 frames per second in Android?

Our target device is Samsung Galaxy P2 , and to transmit video we need to have fps is 33 , ie 33 frame per second, below is the code what i am using,

 List<int[]> supportedPreviewFps=parameters.getSupportedPreviewFpsRange();

Output of this function was 4000 & 35000 , i believe that means, device is supporting 4 frame per sec to 33 frame per seconds,

Now i could do the setFrameRange using below API,

parameters.setPreviewFpsRange(4000,35000);

As it was supporting only this value, and i am getting frame at the gap of 110 ms, i believe, to have 33 fps, the interval should be 30 -- 33 ,

any idea, what to be done ?

This is probably due to the device running out of CPU. The preview callback is rather software intensive, particularly if you ask for a non-native format.

Try using

  adb shell
  $ vmstat -d 1

and look at the amount of idle CPU. If it's zero (or less than ~ 5%), then that's probably where the issue lies.

This isn't easy to mitigate: The only way I'm aware of is to use a SurfaceTexture instead and do as much processing as possible in the GPU.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM