Downloading a Flash video stream under Linux with rtmpdump: Introduction and installation
Version: 1.0 (4/Nov/2010)
Ever wanted to download streaming video and save it to your hard disk for later viewing, archival or editing? This can be an easy task or a daunting one, depending on the video source and format. When the content is hosted in one of the major video websites - Youtube and the likes - you have several easy options; online services such as Keepvid or several applications for your PC allow to do so immediately.
Things become more difficult when the content is hosted in less ordinary websites. In this case, the average online service or download application will not support the website, and you will be stuck. However, in principle, you can still download the video; if the video stream can reach your PC to be played, then it can also be intercepted and saved. You only need the appropriate instruments.
If the video is streamed via the HTTP protocol, the same used for web navigation, then you could just enter the HTTP address of the video in your browser. Nowadays, however, video is normally streamed via the specialized RTMP protocol, or via one of its variants. Ordinary browsers cannot connect to a RTMP server, and this is why videos are usually embedded in web pages via a Flash application (Flash is a programming language commonly used for multimedia applications on the Web). If the video stream you want to capture is being streamed in its own window inside a web page, it is almost sure that what you are facing is a Flash application playing an RTMP stream.
In this case, all you need to download the video stream is the following:
- A special RTMP player which can save the stream to your hard disk;
- The RTMP URL of the video itself.
Under Windows, there are now several applications that can perform the first task, and many will also perform the second, by "spying" the traffic when the embedded Flash application connects to the RTMP server. Under Mac OS X and Linux, at this point in time there is almost nothing like that (though it's likely that there may be in the future). But there is one useful command line tool that can perform the first task for you; it is named rtmpdump.
You can download it from the rtmpdump home page; however, most Linux distributions now have it available as a package. So you may run, as root, one of these commands:
apt-get install rtmpdump yum install rtmpdump emerge rtmpdump
depending whether you are using a Debian/Ubuntu, Fedora/CentOS or Gentoo distribution. Once this succeeds, you can move to the next step.