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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:04:36+00:00 2026-06-09T15:04:36+00:00

So I have been working on a recording module for a larger application. It’s

  • 0

So I have been working on a recording module for a larger application.
It’s fully functional on most devices, but there is one batch of phones that simply refuse recording.

Whenever I start the recording using the MediaRecorder, LogCat will graciously tell me that MediaRecorder failed to start, resulting in error code -12.
I have been scouring the internets for most of the day looking for an explanation to these error codes. So far I have been unlucky. Hence I turn myself to the rest of the developer community.

MediaRecorder start failed -12

More than one question has already been asked about those error codes and more specifically 16, 19, 22 and one ridiculously large number 2147483648, but this information has proven to be useless in my case.

Does anyone know where I can find a reliable list of MediaRecorder error codes including the meaning of these? Or even better, explain to me what the almighty Android oracle is trying to signal me?

Thanks in advance

  • 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-09T15:04:37+00:00Added an answer on June 9, 2026 at 3:04 pm

    My previous answer was not complete.
    After more tinkering I found out that many devices can be very sensitive to settings you would think of being default for most devices, but in fact there are many devices that do not behave the way you would expect and they will crash giving you many different error codes that you will not be able to find on the internet. These error codes range from -12, -19, -21 to -100 etc. and most of these error codes can be resolved by using the tips below. I will give a short list of findings below:

    The HTC ChaCha running API 10 does not record using the H264 encoder. I got it to work using MP4 and/or H263, however the video still came out totally distorted. The solution to that was setting the camera preview size to 640*480 instead of using google’s own “optimal preview” method which returns 576*432. By setting exceptions for this model, I was able to make it record perfectly.

    The Galaxy Y running API 10 crashes when trying to record using H264. Made an exception for this one to use MP4 encoder. Fixed it.

    The Galaxy Ace running API 10 crashes when trying to record using MP4 returning error code -12. Adding an exception using the H264 encoder for this device model fixes the problem.

    The Desire Z running API 10 crashes when trying to record using MP4 encoder. Gave me an error -100 (Media server died). Using H264 fixes the problem.

    if(API >=11){
            if(CamcorderProfile.hasProfile(mCamId, CamcorderProfile.QUALITY_480P)) {
                Log.d(TAG, "API 11+ 480P");
                mMediaRecorder.setProfile(CamcorderProfile.get(mCamId, CamcorderProfile.QUALITY_480P));
                mMediaRecorder.setVideoSize(640, 480);
                mMediaRecorder.setVideoEncodingBitRate(2000000);
            } else {
                Log.d(TAG, "API 11+ LOW");
                mMediaRecorder.setProfile(CamcorderProfile.get(mCamId, CamcorderProfile.QUALITY_LOW));
            }
        } else if (API < 11 && !MODEL.equals("GT-S5830") && !MODEL.equals("vision")){
            mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
            Log.d(TAG, "API 9 device, defaulting");
            mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
            mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
            mMediaRecorder.setVideoSize(640, 480);
            mMediaRecorder.setVideoEncodingBitRate(2000000);
        } else if ((API < 11) && MODEL.equals("GT-S5830") || MODEL.equals("vision")) {
            //Galaxy Ace and Desire Z
            mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
            mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
            mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
            mMediaRecorder.setVideoSize(640, 480);
            mMediaRecorder.setVideoEncodingBitRate(2000000);
        }
    

    I bet I will run into more models being a metaphorical pain in the crack and when I do, I will add them to the list.
    To sum up; if you run into these annoying, almost unexplainable error codes, have a look at the MediaRecorder parameters. I advice against using the CamcorderProfile class for any API below 11, since many of these models crash while using a high quality instance of this.
    If your recorder video file shows weird green colours, semi-diagonal lines running through your screen, etc, try to set the preview size to match the recorder video size.

    Camera.Parameters param = mCamera.getParameters();
    param.setPreviewSize(width, height);
    mCamera.setParameters( param );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working with SQL Server as a Developer a while. One thing
I have been working on a large java application. It is quite parallel, and
I have been working on a project on and off, but I haven't touched
I have a working mic recording script in AS3 which I have been able
I have been working with Xcode 4.2.1, but following some tutorials and videos from
I have been recording Twitter data for a project I'm working on the date
I have a multi-tier Azure application I've been working on. It uses web and
I have been working with boost serialization, I developed a whole module to store
I have been working with Coded UI Test(CUIT) feature of VS2010 . When recording
I have been working on an android application in which I have to integrate

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.