10

I'm testing my application on Samsung Galaxy Ace, and I get the supported sizes with

cameraParams.getSupportedPictureSizes();

It works with all of them except of (320 x 240) - the preview turns black and I get this error: Camera Error 100

Volo
  • 28,673
  • 12
  • 97
  • 125
dev mz
  • 397
  • 2
  • 3
  • 12

5 Answers5

13

Camera Error 100 - "Media server died. In this case, the application must release the Camera object and instantiate a new one."

Do what the SDK says and release the camera object and make a new one.

http://developer.android.com/reference/android/hardware/Camera.html

Read this, too. It might help you: Droid's mediaserver dies on camera.takePicture()

Community
  • 1
  • 1
Chris
  • 1,569
  • 2
  • 11
  • 18
1

I had error 100 on samsung galaxy s3. The problem in my case was in camera dimensions. I followed android developers camera guide and was setting video size (setVideoSize (widht,height)) in prepareVideoRecorder();

But I was setting wrong dimension what caused camera freeze,crash with error 100 and "camera server died".

The solution is:

adding next two lines

   mPreviewHeight = mCamera.getParameters().getPreviewSize().height;
   mPreviewWidth = mCamera.getParameters().getPreviewSize().width;

in block (in surfaceChange method):

  try {
      mPreviewHeight = mCamera.getParameters().getPreviewSize().height;
      mPreviewWidth = mCamera.getParameters().getPreviewSize().width;

      mCamera.setPreviewDisplay(mHolder);
      mCamera.startPreview();
  } catch (Exception e){
      Log.d(TAG, "Error starting mCamera preview: " + e.getMessage());
  }

and then in prepareVideoRecorder() setting this parameters to camera:

  mMediaRecorder.setVideoSize(mPreviewWidth, mPreviewHeight);
Alex Perevozchykov
  • 2,211
  • 22
  • 19
0

I solved the issue by removing usage or setting the of the Camera parameter:

setAutoWhiteBalanceLock(false);

Robert
  • 5,278
  • 43
  • 65
  • 115
Julien Pipard
  • 21
  • 1
  • 6
0

I get the error when i use camera with gLSurfaceView for preview. I fixed the bug by Comment out

//params.setRecordingHint(true);
0

Removing the preview format might help in this case. I was setting the preview format as

param.setPreviewFormat(ImageFormat.YV12);

Removing above line solved the problem for me.

Vikalp
  • 2,051
  • 4
  • 18
  • 24