title: How do you encode a video with audio using MediaCodec
body: <p>So, I have encoded a h264 elementary stream with MediaCodec by collectings the frames using Camera's onPreviewFrame method.(using <a href="https://stackoverflow.com/questions/13458289/encoding-h-264-from-camera-with-android-mediacodec">Encoding H.264 from camera with Android MediaCodec</a>). Then, I generated an mp4 video using the h264 stream. Unfortunately, it doesn't have any audio in it.</p>
  
  <p>I notice that MediaCodec should also allow encoding audio because it has settings for audio codecs.</p>
  
  <p>Now is there any ways to add audio to the h264 stream?</p>
  
  <p>thanks for reading and would appreciate any comments or suggestions.</p>