title: Receive and interprete video stream with gstreamer
body: <p>I wrote a small program for my Andorid phone that transmits its camera stream via tcp to my pc. The phone acts as the client while on the pc gstreamer should receive the stream. Therfore I use following command:</p>
  
  <pre><code>&gt;&gt;gst-launch -v tcpserversrc port=8888 host=XXX.XX.XX.XXX ! \
  filesink location=test.mpg
  </code></pre>
  
  <p>This methods produces a corrupted media file that does not contain a valid header. The output of </p>
  
  <pre><code>&gt;&gt;file test.mpg 
  test.mpg: ISO Media, MPEG v4 system, 3GPP
  </code></pre>
  
  <p>But when I use mplayer, i get the following:</p>
  
  <pre><code>&gt;&gt;mplayer test.mpg
  ...
  Playing test.mpg.
  libavformat file format detected.
  [mov,mp4,m4a,3gp,3g2,mj2 @ 0x9b22850]moov atom not found
  LAVF_header: av_open_input_stream() 
  failed                                                               
  Seek failed
  libavformat file format detected.
  LAVF_header: av_open_input_stream() failed
  
  Exiting... (End of file)
  </code></pre>
  
  <p>You can download the file at  <a href="https://docs.google.com/open?id=0Bwg55BOeLkowNjk1NTM0MjctMTZjYS00NDNmLTlkM2QtNmJlZTg5ZTExZDRm" rel="nofollow">https://docs.google.com/open?id=0Bwg55BOeLkowNjk1NTM0MjctMTZjYS00NDNmLTlkM2QtNmJlZTg5ZTExZDRm</a> (As described it is not played due to wrong format but you can click to download on the left)</p>
  
  <p><strong>Its quite crazy, if I record the stream in a file on the android devices I get a valid video file, that runs without any problem!</strong></p>
  
  <p>The configuration of the android camera is defined by</p>
  
  <pre><code>recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
  recorder.setVideoSize(320,240);
  recorder.setVideoFrameRate(15);
  </code></pre>
  
  <p>How do I have to parameterize gstreamer to watch the stream?</p>
  
  <p>Best wishes from Germany
  Enjoy the weekend</p>
  
  <p>Poseidonius</p>