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 7040909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:58:28+00:00 2026-05-28T01:58:28+00:00

Hi I am trying to make a camera with SurfaceView and Camera classes. Here

  • 0

Hi I am trying to make a camera with SurfaceView and Camera classes. Here everything works fine except for zoom feature. When I click on zoom before starting to record using the MediaRecorder it works but if I start recording and click on zoom it crashes. Here is my code. How do I go about adding zoom facility to my camera. Any help is much appreciated. Thanks.

This is my code to smoothZoom,

 zoomControls.setOnZoomInClickListener(new OnClickListener() {

        public void onClick(View v) {

            try
            {
            currentZoomLevel++;
            myCamera.startSmoothZoom(currentZoomLevel);


            }catch(IllegalArgumentException e)
            {
                currentZoomLevel--;
                zoomControls.setIsZoomInEnabled(false);
            }
        }
    });


    Parameters parameters = myCamera.getParameters();
    parameters.setFlashMode(getFlashModeSetting());
    myCamera.setParameters(parameters);

    mediaRecorder = new MediaRecorder();
    myCamera.unlock();
    mediaRecorder.setCamera(myCamera);
    mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
    mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
    mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
    mediaRecorder.setOutputFile("/sdcard/myvideo.mp4");
    mediaRecorder.setPreviewDisplay(myCameraSurfaceView.getHolder().getSurface());

here is my logact,

08-21 14:05:36.171: ERROR/AndroidRuntime(6426): FATAL EXCEPTION: main
08-21 14:05:36.171: ERROR/AndroidRuntime(6426): java.lang.RuntimeException: start smooth zoom failed
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at android.hardware.Camera.startSmoothZoom(Native Method)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at com.camvideocorder.CamVideoCorderActivity$2.onClick(CamVideoCorderActivity.java:95)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at android.view.View.performClick(View.java:2485)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at android.view.View$PerformClick.run(View.java:9089)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at android.os.Handler.handleCallback(Handler.java:587)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at android.os.Handler.dispatchMessage(Handler.java:92)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at android.os.Looper.loop(Looper.java:123)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at android.app.ActivityThread.main(ActivityThread.java:3806)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at java.lang.reflect.Method.invokeNative(Native Method)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at java.lang.reflect.Method.invoke(Method.java:507)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-21 14:05:36.171: ERROR/AndroidRuntime(6426):     at dalvik.system.NativeStart.main(Native Method)
  • 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-05-28T01:58:28+00:00Added an answer on May 28, 2026 at 1:58 am

    Can you specify which version of android you are using? Zooming when recording video feature is added only in android 4.0.

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

Sidebar

Related Questions

Hey i'm trying to make a GUI lib with SFML, and everything's done except
I'm trying to make free camera, everything looks good, but I can't move it.
I'm trying to make a basic application that displays an image from the camera,
I'm trying to make a very simple iphone app that displays the real-time camera
I'm trying to make a zoom system for a C#/XNA game I'm working on.
Alright, so I'm still trying to make my players movements relative to the camera.
I am successfully able to Make custom Zoom using Slider in my Custom Camera
Hey all. Quick question here. I'm trying to keep the camera centered on the
I'm trying to make a camera app using AVCaptureSession. For now I just want
Hi everyone I am trying to make a camera app. I am doing this

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.