title: Using EXTRA_OUTPUT for an ACTION_VIDEO_CAPTURE intent crashes the Camara App
body: <h2>Code</h2>
  
  <pre><code>String dirPath = File.separator + "Android" + File.separator + "data" + File.separator + context.getPackageName() + File.separator + "mediaDir" + File.separator;
  
  // Path where I want the recorded video to be placed.
  File videoFile = new File(Environment.getExternalStorageDirectory() + dirPath + "videoName.mp4"); 
  
  Uri videoFileUri = Uri.fromFile(videoFile); 
  intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
  intent.putExtra(MediaStore.EXTRA_OUTPUT, videoFileUri);
  
  startActivityForResult(intent, VIDEO_CAPTURE_CODE);
  </code></pre>
  
  <hr>
  
  <h2>LogCat output</h2>
  
  <pre><code>A/StagefrightRecorder(11209): frameworks/base/media/libmediaplayerservice/StagefrightRecorder.cpp:636 mOutputFd &gt;= 0**
  ...
  &lt;A very long memory dump&gt;
  ...
  W/Camera(18796): ICamera died
  ...
  E/Camera(18796): Error 100
  </code></pre>
  
  <hr>
  
  <p>This bug occours in <code>HTC Nexus One</code> phone, while not in newer devices like <code>Nexus 7</code>. It seems to be <a href="https://code.google.com/p/android/issues/detail?id=1480" rel="nofollow">this bug</a>, in which several device makers like HTC, Motorola, etc re-implemented the camara app re-introducing this bug that fixed using the <code>EXTRA_OUTPUT</code>.</p>
  
  <p>Is there a way to get this working properly in devices like the <code>Nexus One</code>? (apart from not using <code>EXTRA_OUTPUT</code> and then copying the file when received <code>onActivityResult</code> to the desired destination)</p>
  
  <p>Note:
  I've already tried several things like making sure the destination file exists, using <code>createNewFile</code> and <code>mkdirs</code>.</p>
  
  <p><strong>Update:</strong>
  Updated the code to show where the file is to be placed.</p>