RTSPget - download an RTSP stream

Note: This was taken from Christopher N. Deckard's RTSPget page, which was taken from Ian Collier's RTSPget page. I've fixed cnd's version to work with xine-lib 1-rcX (tested with 1-rc6). It should be compatible with xine-lib 1.0, whenever that is released. I wasn't able to find cnd's contact info, so here's another new page. Some of this information is quite dated. For instance, xine can now save streams by appending `#save:/path/to/file' to a MRL (e.g. `xine rtsp://blah/asdf.rm#save:/tmp/asdf.rm'. But I still wanted something that isn't xine-ui. -Trisk

A frequently recurring question is "How can I download an RTSP stream so that I can watch it later?" This is probably because your network bandwidth isn't high enough to make the stream watchable live, or it may just be because you want to save it for later.

Now that the folks at xine have implemented an RTSP input filter, you can do just that! However, until stream-dumping is included in xine (or RTSP is included in Mplayer) the only way to do it seems to be via a program which calls xine's RTSP code directly.

Notes:

Source code

Build instructions

  1. First build the `libreal' and `librtsp' libraries from the xine distribution. If you haven't already built the whole of xine then something like the following might work.
     $ cd /usr/src/xine-lib-1-rc6
     $ ./configure <options>
     $ cd src/input/libreal
     $ make
     $ cd ../librtsp
     $ make
     $ cd ../xine-engine
     $ make
    
  2. Now compile the two source files. You will need access to some of the include files from the xine source tree. Edit the `build' script so that the XINEBUILD setting points to the directory you compiled xine-lib in, then run `./build' in the same directory as the two source files.
     $ cd /usr/src/rtspget
     $ ./build
    

Using it

For best results, supply an MRL and an output file name (in that order). The MRL must start with `rtsp://'. You can also write (in any order):

-qbe quiet
-vbe verbose
-ochoose the output file name.

Note: `-o' can either be followed by a file name or placed last on the command line: in the latter case, the output file will be named after the MRL's base name (starting from the last slash).

If you don't name an output file, the program will output to stdout - although you probably don't want it to do that, for reasons explained below.

If you don't specify the quiet flag you'll get a running count of bytes downloaded so far (this is displayed on stderr).

Beware!

The RTSP code in xine is not perfect, so you may encounter some problems. There were issues with big-endian systems in earlier versions that have since been corrected.

That's it

Yup. Enjoy!