title: Android MediaRecorder setOutPutFile() to stream using Socket
body: <p>I am developing an Android app that should be capable of streaming video to a local server on my network without storing it on SD card.</p>
  
  <p>For this I have made simple socket application in C# that listens to the specific IP:PORT </p>
  
  <p>On Android part, I had set the <code>setOutputFile()</code> to this IP:PORT using socket.</p>
  
  <p>This application starts perfectly on Android phone but it does not display preview and when I start recording it exits without any exception. It also do not send any data stream to the network. </p>
  
  <p>When I set the <code>setOutPutFile()</code> to SD card, it works perfectly and records video also.</p>
  
  <p>For the server part, when I send the data from any other app (from PC) to the same IP:PORT, it receives the data. </p>
  
  <p>In short, I want to establish the communication channel between PC and Android using socket for streaming.</p>
  
  <p><strong>Here is my Android code:</strong></p>
  
  <pre><code> Socket soc=new Socket("192.168.1.3",8210);
   ParcelFileDescriptor pfd = ParcelFileDescriptor.fromSocket(soc);
   ...
   ...
   // other Recorder setup steps
   ...
   ...
   Recorder.setOutputFile(pfd.getFileDescriptor()); // working fine for sdcard
   Recorder.setPreviewDisplay(holder.getSurface());
   Recorder.prepare();
  </code></pre>
  
  <p><strong>Here is my server app that is in C# and runs on PC:</strong></p>
  
  <pre><code> socketForServer = new TcpClient("192.168.1.3", 8210);
   NetworkStream networkStream = socketForServer.GetStream();
   byte[] rData = new byte[1024];
   networkStream.Read(rData, 0, 1024);
   ...
   ...
   // process rData
   ...
   ...
  </code></pre>
  
  <p>I am not able to understand the problem that is occurring here. Am I going in right direction? </p>