Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing Burst mode on android camera

Tags:

android

camera

I'm trying to implement burst mode on android's camera (currently on ICS) I've searched over the net trying to find some documentation about this features and encounter with several issues:

  • Need to save (probably on asynctask) every captured image values and afterwards process it and save it in sd card

  • Probably handle the heap while capturing images in continuous mode

So far that's the first impression I got when investigating this issue, Can someone guide me where can I get more information, algorithms maybe or even source code for example?

Thanks for the help. Udi

like image 715
Udi Oshi Avatar asked Oct 30 '12 13:10

Udi Oshi


2 Answers

You may also check this code as a baseline: https://github.com/rdasxy/android-burst-camera . Also check this first: http://developer.android.com/guide/topics/media/camera.html. For your preview use TextureView (you need to add hardware accelleration to your AndroidManifest.xml) instead of SurfaceView. You might run out of heap quite fast if you try to cache the pictures in memory, especially if you set the picture size to a large value. Thus, save the data as soon as you receive it in method pictureCallBack.onPictureTaken by using e.g. an AsynchTask. Check (measure!) the write speed of your device's internal memory in contrast to the sdcard write speed. You might get higher overall process performance when saving to the device's internal memory first and move it to sdcard later if required. Also try to motivate the android system to provide you larger heap size by adding largeHeap=true to your AndroidManifest.xml

like image 143
Megan Scott Avatar answered Nov 15 '22 04:11

Megan Scott


This question is somewhat similar to this question on stack overflow. The code in that question could help.

like image 34
TheRookierLearner Avatar answered Nov 15 '22 04:11

TheRookierLearner