title: How can I record an rtsp video stream to a file from a linux command line?
body: <p>I have a net cam which provides a rtsp stream via the default 554 port.</p>
  
  <p>I can view the stream perfectly using VLC (GUI mode) when I open rtsp://192.168.1.7/1234</p>
  
  <p>(the "1234" is the [default] password the device requires to be in the url, for those who want to restrict access to the stream)</p>
  
  <p>What I need is to have a cli-only linux box record the stream.</p>
  
  <p>Googling a bit found this suggestion:</p>
  
  <pre><code>mplayer -noframedrop -dumpfile out.rm -dumpstream rtsp://192.168.1.7/1234
  </code></pre>
  
  <p>However, this results in:</p>
  
  <pre><code>MPlayer UNKNOWN-4.2.1 (C) 2000-2009 MPlayer Team
  141 audio &amp; 304 video codecs
  
  Playing rtsp://192.168.1.7:554/1234.
  Resolving 192.168.1.7 for AF_INET6...
  Couldn't resolve name for AF_INET6: 192.168.1.7
  Connecting to server 192.168.1.7[192.168.1.7]: 554...
  rtsp_session: unsupported RTSP server. Server type is 'unknown'.
  Resolving 192.168.1.7 for AF_INET6...
  Couldn't resolve name for AF_INET6: 192.168.1.7
  Connecting to server 192.168.1.7[192.168.1.7]: 554...
  http_read_response read 0 (i.e. EOF).
  No stream found to handle url rtsp://192.168.1.7:554/1234
  
  
  Exiting... (End of file)
  </code></pre>
  
  <p>I tried this both on a Debian and on an OS X 10.6 machine.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks!</p>