title: VLC desktop streaming
body: <p><b>Edit</b><br/>
  I stopped using VLC and switched to <a href="http://www.google.be/search?q=GMax+FLV+Encoder+3.8.0.0" rel="nofollow noreferrer">GMax FLV Encoder</a>. It does a much better job IMO.</p>
  
  <p><b>Original post</b><br/>
  I am sending my desktop (screen) as an H264 video stream to another machine that saves it to a file using the follwoing command lines:</p>
  
  <p>Sender of the stream:</p>
  
  <pre><code>vlc -I dummy
      --sout='#transcode{vcodec=h264,vb=512,scale=0.5}
              :rtp{mux=ts,dst=192.168.0.1,port=4444}'
  </code></pre>
  
  <p>Receiver of the stream:</p>
  
  <pre><code>vlc -I rc
      rtp://@:4444
      --sout='#std{access=file,mux=ps,dst=/home/user/output.mp4}'
      --ipv4
  </code></pre>
  
  <p>This works, but there are a few issues:</p>
  
  <ul>
  <li>The file is not playable with most players.</li>
  <li>VLC is able to playback the file but with some weirdness:</li>
  <li>=> it takes about 10 seconds before the playback actually begins.</li>
  <li>=> seeking doesn't work.</li>
  </ul>
  
  <p>Can someone point me in the right direction on how to fix these issues?</p>
  
  <p><b>EDIT</b>: I made a little progress.</p>
  
  <p>The initial delay in playback is because the player is waiting for a keyframe. By forcing the sender of the stream to create a new key-frame every 4 seconds I could decrease the delay:</p>
  
  <pre><code>:screen-fps=10
  --sout='#transcode{vcodec=h264,venc=x264{keyint=40},vb=512,scale=0.5}
         :rtp{mux=ts,dst=192.168.0.1,port=4444}'
  </code></pre>
  
  <p>The seeking problem is not solved however, but I understand it a little better. The RTP stream is saved as a file in its original streaming format, which is normally not playable as a regular video file. VLC manages to play this file, but most other players don't. So I need to convert it to a regular video file. I am currently investigating whether I can do this with ffmpeg if I provide it with an SDP file for the recorded stream.</p>
  
  <p>All help is welcome!</p>