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 :-(
Burst mode works with both the rear- and front-facing cameras. Burst mode captures an impressive 10 photos per second. This nifty functionality means you are more likely to capture the perfect moment of action.
Your device supports a photo shooting mode called Burst shot. This mode lets you quickly capture up to 30 photos with just one touch and play them through one-by-one like a video.
The only way to split the burst photos is to connect your phone to a computer and navigate to the DCIM/Pictures folder and you should see the individual images there.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With