Saving Real Media streams

Saving Real Media streams

I like to watch Berkley’s stream lectures. I do not like to have to start at the beginning of a lecture and wait for the buffer to catch up to where I was last time before I got interrupted. After some googling I was able to find out how to save real media streams with mplayer. Below is a bash script I wrote in order to download EE 140 lectures:

url="rtsp://169.229.131.16:554//bibs/s2004/group1/ee140"
for fname in "20040120" "20040122" "20040127" "20040129" "20040203" "20040205""20040210" "20040212" "20040217" "20040219" "20040224" "20040226" "20040302""20040304" "20040309" "20040311" "20040316" "20040318" "20040323" "20040325" "20040330" "20040401" "20040406" "20040408" "20040413" "20040415" "20040420" "20040422" "20040427" "20040429" "20040504" "20040506" "20040511"
do 
	mplayer -bandwidth 2000000 -cache 3000 -noframedrop -dumpfile "$fname.rm" -dumpstream $url/"$fname.rm"
done

-bandwidth 2000000 set the download rate to 2Mbps without this data downloads in real time which means it takes 60 minues to download a 60 minute lecture.

-cache 3000 is useful because you are downloading a lot faster than real time

-noframedrop and -dumpfile should be pretty self explanatory

-rtsp is the proprietary protocol which real media streams with $url is taken from inspecting the .rm files

As far as I know this method can be employed for any streaming media mplayer can playback. I haven’t tried it on anything except the Berkley lectures.

Refereces:

http://ubuntuforums.org/showthread.php?t=635058

http://thomer.com/howtos/capture_realstream.html (howto stream audio only)