Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8413527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:56:11+00:00 2026-06-10T00:56:11+00:00

Scenario: I need to take a picture as fast as possible and save it

  • 0

Scenario:

I need to take a picture as fast as possible and save it to SD Card. It would be fantastic if I could do it in around 0.2 seconds both taking the picture and saving it.

What I did so far:

As normal I’ve created a SurfaceView to handle the Camera preview and initialized the camera object. The quality of the image doesn’t need to be very high, that’s why I am not using the largest resolution possible and also no autofocus is required.
I set the parameters like this:

 Parameters parameters = camera.getParameters();
 parameters.set("jpeg-quality", 70);

 parameters.setPictureFormat(ImageFormat.JPEG);
 List<Camera.Size> sizes = parameters.getSupportedPictureSizes();
 Size size = sizes.get(Integer.valueOf((sizes.size()-1)/2)); //choose a medium resolution
 parameters.setPictureSize(size.width, size.height);
 camera.setParameters(parameters);
 camera.setDisplayOrientation(90);

 List<Size> sizes2 = parameters.getSupportedPreviewSizes();
 Size size2 = sizes.get(0);

 parameters.setPreviewSize(size2.width, size2.height);
 camera.setPreviewDisplay(holder);
 camera.startPreview();

I save the image to SD card very simple with:

PictureCallback handlePictureStorage = new PictureCallback() {
        @Override
        public void onPictureTaken(byte[] data, Camera camera) {
            FileOutputStream outStream = null;

            try {
                outStream = new FileOutputStream(String.format("/sdcard/%d.jpg", System.currentTimeMillis()));
                outStream.write(data);
                outStream.close();       
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
            }
        }
    };

After making a few tests, on my Galaxy Nexus, the result looks like:

  • Setting picture size to : wigth=1600 height=1200
  • Jpeg quality : 70, Picture format JPEG
  • Fire take picture at: 00:13:23.603
  • Start saving picture on SD Card at: 00:13:23.956
  • Finished saving picture on SD Card at: 00:13:23.990

This is almost 0.4 seconds.
Is there a way to tweak the Camera parameters even more to gain some faster speed ? The resolution is OK, the quality of the picture also. I know that there are apps on market that have 30 pictures per second but I think they use buffering to achieve that speed. However, as you may see the biggest time is lost with taking the picture rather than saving it to card. It would be great if I could tweak this a bit more.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:56:12+00:00Added an answer on June 10, 2026 at 12:56 am

    After I did a bit of testing with multiple parameters, conclusion is that not much is left to be done. Here are some parameters I’ve set:

      //set color efects to none
     cameraParameters.setColorEffect(Camera.Parameters.EFFECT_NONE);
    
      //set antibanding to none
     if (cameraParameters.getAntibanding() != null) {
     cameraParameters.setAntibanding(Camera.Parameters.ANTIBANDING_OFF);
     }
    
     // set white ballance
     if (cameraParameters.getWhiteBalance() != null) {
     cameraParameters.setWhiteBalance(Camera.Parameters.WHITE_BALANCE_CLOUDY_DAYLIGHT);
     }
    
      //set flash
     if (cameraParameters.getFlashMode() != null) {
     cameraParameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
     }
    
      //set zoom
     if (cameraParameters.isZoomSupported()) {
     cameraParameters.setZoom(0);
     }
    
     //set focus mode
     cameraParameters.setFocusMode(Camera.Parameters.FOCUS_MODE_INFINITY);
    

    However, the best idea is to get the full string list of parameters supported by the camera, and try to tweak them. To get the string, use the flatten method of Camera.Parameters – http://developer.android.com/reference/android/hardware/Camera.Parameters.html#flatten()

    But in order to get images really quick, I had to use preview with buffer, and for each frame taken, try to save it on sd-card in a thread. The picture quality isn’t fantastic, but it’s a start.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a possible implementation scenario where I need a dictionary object that will
Scenario : You need to expose the same app on different screens - let's
Here's my scenario: I need to make three or four calls to different WCF
I have: Textbox(Multi-line) Panel Different controls inside panel (buttons,textbox) Scenario: I need to add
I am a complete beginner to Qt. In a test scenario I need to
I have scenario where I need to host a web service (WCF) on Azure
I have one scenario where I need to select all files having aliencoders.numeric-digits like
I have a scenario where I need to load properties from database or java
I have a scenario where I need to do the following in a transaction:
I have a scenario where I need to search from many binary files (using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.