title: RecordVideo: java.lang.RuntimeException: start failed
body: <p>I have a problem with video reocrding on nexus s with android 4.1.2. </p>
  
  <pre><code> private static final String OUTPUT_FILE="/storage/sdcard0/uatestvideo1.mp4";
  </code></pre>
  
  <p>Android Manifest: </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
  &lt;uses-permission android:name="android.permission.CAMERA"/&gt;
  &lt;uses-permission android:name="android.permission.RECORD_AUDIO"/&gt;
  &lt;uses-permission android:name="android.permission.RECORD_VIDEO"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/&gt;
      &lt;uses-permission android:name="android.permission.STORAGE" /&gt;
  &lt;uses-feature android:name="android.hardware.camra"/&gt;
  </code></pre>
  
  <p>onCreate: In oncreate I have:
  ...</p>
  
  <pre><code>final SurfaceHolder holder =    videoView.getHolder();
  holder.addCallback(this);
  holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
  </code></pre>
  
  <p>...</p>
  
  <pre><code>private void beginRecording(SurfaceHolder holder) throws Exception{
  
          if(recorder!=null){
              recorder.stop();
              recorder.release();
              recorder=null;
          }
          File outFile = new File(OUTPUT_FILE);
          if(outFile.exists()){
              outFile.delete();
          }
  
          try{
              recorder = new MediaRecorder();
              recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
              recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
              recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
              recorder.setVideoSize(320, 240);
              recorder.setVideoFrameRate(15);
              recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
              recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
              recorder.setMaxDuration(200000);
              recorder.setPreviewDisplay(holder.getSurface());
              recorder.setOutputFile(OUTPUT_FILE);
              recorder.prepare();
                  recorder.start();
          }catch(Exception e){
              Log.e(TAG, e.toString());
              e.printStackTrace();
          }
  
      }
  
  
  }
  </code></pre>
  
  <p>ERRORS:</p>
  
  <pre><code>11-25 10:46:07.723: E/MediaRecorder(15354): start failed: -19
  11-25 10:46:07.727: E/RecordVideo(15354): java.lang.RuntimeException: start failed.
  11-25 10:46:07.727: D/Blad w rekorder(15354): java.lang.RuntimeException: start failed.
  11-25 10:46:07.727: W/System.err(15354): java.lang.RuntimeException: start failed.
  11-25 10:46:07.727: W/System.err(15354):    at android.media.MediaRecorder.start(Native Method)
  11-25 10:46:07.727: W/System.err(15354):    at com.plym.andr.UsVideoRecorder.beginRecording(UsVideoRecorder.java:198)
  11-25 10:46:07.727: W/System.err(15354):    at com.plym.andr.UsVideoRecorder.access$2(UsVideoRecorder.java:168)
  11-25 10:46:07.727: W/System.err(15354):    at com.plym.andr.UsVideoRecorder$1.onClick(UsVideoRecorder.java:76)
  11-25 10:46:07.727: W/System.err(15354):    at android.view.View.performClick(View.java:4084)
  11-25 10:46:07.727: W/System.err(15354):    at android.view.View$PerformClick.run(View.java:16966)
  11-25 10:46:07.731: W/System.err(15354):    at android.os.Handler.handleCallback(Handler.java:615)
  11-25 10:46:07.731: W/System.err(15354):    at android.os.Handler.dispatchMessage(Handler.java:92)
  11-25 10:46:07.731: W/System.err(15354):    at android.os.Looper.loop(Looper.java:137)
  11-25 10:46:07.731: W/System.err(15354):    at android.app.ActivityThread.main(ActivityThread.java:4745)
  11-25 10:46:07.731: W/System.err(15354):    at java.lang.reflect.Method.invokeNative(Native Method)
  11-25 10:46:07.731: W/System.err(15354):    at java.lang.reflect.Method.invoke(Method.java:511)
  11-25 10:46:07.731: W/System.err(15354):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
  11-25 10:46:07.731: W/System.err(15354):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  11-25 10:46:07.731: W/System.err(15354):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>