title: android video recording with duration limit and low quality
body: <p>I need to record video for 8 seconds in my app. I am using <strong>MediaStore.ACTION_VIDEO_CAPTURE</strong> intent for video recording and using these parameters <strong>(MediaStore.EXTRA_VIDEO_QUALITY,MediaStore.EXTRA_DURATION_LIMIT)</strong> to set quality and duration limit of video recording. but i encountered a very interesting bug i.e. when i set duration limit to 8 seconds and video quality to 1, its working fine and is recording video for 8 seconds but as soon i changes the video quality to 0 and keeping everything same, the video is now recorded for 21 seconds. I am using <strong>sony Xperia</strong> phone for testing, but when i shift to <strong>HTC</strong>, duration limit not working in any case neither on setting video quality to 1 nor on setting it to 0.</p>
  
  <p>So i don't know what is happening right now. In severe need. please help. Thanks in advance.</p>
  
  <p>Here is the code I am using..</p>
  
  <pre><code>private void recordVideo() {
      Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
  
      File f = null;
  
      try {
          f = setUpVideoFile();
          filePath = f.getAbsolutePath();
          intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));
      } catch (IOException e) {
          e.printStackTrace();
          f = null;
          filePath = null;
      }
      objectGlobal.setFilepath(filePath);
      intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
      intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 8);
      startActivityForResult(intent, CAMERA_CAPTURE_VIDEO);
  }
  </code></pre>