Reputation: 12112
I was trying to implement a burst mode camera in my app, which can take multiple pictures at the rate of 5-10(or more) snaps per second.
FYI I already saw the previous questions here, here and here - tried and failed with speed. Also the questions are old and there are no comprehensive answers addressing all the concerns like how to manage heap etc.
I would really appreciate if someone can help with useful pointers, best practice or maybe an SSCCE.
Update :
Tried successfully with pulling preview frames @ 15+snaps/sec, but the problem is preview size is limited. On nexus 5 I can get only 1920x1080 which is ~2mp, whereas the full resolution pic possible on n5 is 8mp :-(
Upvotes: 9
Views: 6669
Reputation: 1007534
Short of device-specific APIs offered by their manufacturers, the only way you can get a "burst mode" that has a shot of working across devices will be to use the preview frames as the images. takePicture()
has no guarantees of when you will be able to call takePicture()
again.
Upvotes: 7
Reputation: 12491
I think a big part of the problem is the question: How does burst mode work in current phones? A couple of blogs point out that Google has confirmed that they will be adding a burst mode API.
I suspect current implementations work by setting exposure time to minimum and calling takePicture in a loop or using Camera.PreviewCallback
I played around with the latter for some computer vision projects and happened to look into writing a burst mode camera using this API. You could store the buffers you receive from Camera.PreviewCallback in memory and process them on a background thread.
If I remember correctly, the resolution was lower than the actual camera resolution, so this may not ideal.
Upvotes: 7