title: How to record video in MPEG-2 TS output and ACC audio encoding format
body: <p>When I set video format MPEG-2(Constant value 8) TS and audio format ACC(Constant value 3) it records video only without audio in ACC format. But it doesn't give any error. I tried it on Samsung Galaxy Tab(Honeycomb). Because MPEG-2TS supports on android version 3.0+. If I use default video and audio format it works fine.
  How can I do this. Please help.</p>
  
  <pre><code>if(mCamera == null) {
      mCamera = Camera.open();
      mCamera.unlock();
  }
  
  
  if(mMediaRecorder == null) mMediaRecorder = new MediaRecorder();
  
  mMediaRecorder.setPreviewDisplay(surface);
  mMediaRecorder.setCamera(mCamera);
  mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
  mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);   
  mMediaRecorder.setOutputFormat(8);
  mMediaRecorder.setOutputFile("/mnt/sdcard/temp.ts");
  mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
  mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
  mMediaRecorder.setVideoSize(640, 480);
  
  mMediaRecorder.setVideoEncodingBitRate(500000);
  mMediaRecorder.setAudioEncodingBitRate(44100);
  mMediaRecorder.setVideoFrameRate(30);
  mMediaRecorder.setMaxDuration(-1);   
  mMediaRecorder.prepare();
  </code></pre>