Download rtmp flash video from Linux

To watch a streaming flash video (rtmp streaming) from a tv website without the flash plugin, you can download the video to your computer like this :

  1. Open the web page with firefox. Right click and view the source of the page.
  2. Look for the “<embed>” markup of the video, such as <embed src=”http://site.tv/player.swf?admin=false&amp;autoPlay=true&amp;videorefFileUrl=http%3A%2F%2Fsite.tv%2Fvideos%2FmyFilm%2Cvideo.xml” […]>
  3. The URL of the XML file (in red here) contains the real reference to the video. So let’s copy it into the browser’s address bar, and replace the escaped characters by their values : http://site.tv/videos/myFilm,video.xml
  4. The XML file is now displayed in firefox. Look for the video itself (there might be more than one, for example SD or HD) and get its url. For example rtmp://site.tv/365/2744?lg=en
  5. Install flvstreamer (apt-get install flvstreamer in Ubuntu, urpmi flvstreamer in Mandriva and so on…)
  6. Run it with the rtmp URL : flvstreamer -o outputFile.flv -r “rtmp://site.tv/365/2744?lg=en
  7. If the download is not complete and you get the message ERROR: ReadPacket, failed to read RTMP packet header
    Download may be incomplete (downloaded about 57.20%), try resuming
    Just resume the download with the same command, plus the -e option :
    flvstreamer -e -o outputFile.flv -r “rtmp://site.tv/365/2744?lg=en”
  8. Repeat that last command as long as the file is not complete.
  9. Read the file with mplayer or vlc !
This entry was posted in TechTips. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*