title: Android Camera Capture using FFmpeg
body: <p>Am tryin' to take the preview frame generated by the android camera and pass the <code>data[]</code> to ffmpeg input pipe to generate a flv video.
  The command that I used was : </p>
  
  <pre><code>ffmpeg -f image2pipe -i pipe: -f flv -vcodec libx264 out.flv
  </code></pre>
  
  <p>I've also tried to force the input format to <code>yuv4mpegpipe</code> and <code>rawvideo</code> but with no success...
  The default format of the preview frame generated by android-camera is <code>NV21</code>.
  The way am invokin' ffmpeg is through the <code>Process API</code> and writing the preview frames <code>data[]</code> to the process' <code>stdin</code>...
  The <code>onPreviewFrame()</code> definition is as follows : </p>
  
  <pre><code>public void onPreviewFrame(byte[] data, Camera camera)
  {   
      try
      {
          processIn.write(data);
      }
      catch(Exception e)
      {
          Log.e(TAG, FUNCTION + " : " + e.getMessage());
      }               
      camera.addCallbackBuffer(new byte[bufferSize]);
  }
  </code></pre>
  
  <p><code>processIn</code> is connected to the <code>ffmpeg</code> process <code>stdin</code> and <code>buffersize</code> is computed based on the documentation provided for <code>addCallbackBuffer()</code>.
  Is there something that am doin' wrong...?</p>
  
  <p>Thanks...</p>