How to download stream videos with rtmp protocol? From Harvard Extension, more specifically

file-downloadrtmpvideo streaming

I've been having trouble downloading video lectures from Harvard Extension School. I was hoping I could take CS171, but I found myself having to spend awful lot of time waiting for endless buffering. So I wish to find a way to have the lectures downloaded and watch them locally.

So I tried to view the page's source code (take the first lecture for example), I found the FlashViewer is linked with an XML url. I followed the link, and found that between the "rtmp" tags was a link to an mp4 file: "rtmp://flash.dce.harvard.edu/bounce/mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16×9-852×480.mp4" and I believed that's it, the file I was looking for.

Then comes the problem with downloading. I've run some vast search, and tried multiple times. None worked.

One way that I tried was running

    $ wget rtmp://flash.dce.harvard.edu/bounce/mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4

on my Ubuntu, with a response of

    rtmp://flash.dce.harvard.edu/bounce/mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4: Unsupported scheme `rtmp'.

I'm not sure what that means…

I've also tried rtmpdump, acquired via apt-get. And when I run

    $ rtmpdump -r rtmp://flash.dce.harvard.edu/bounce/mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4 -o lecture1.mp4

I get

    RTMPDump v2.4
    (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
    Connecting ...
    INFO: Connected...
    ERROR: Closing connection: NetStream.Play.Failed

I don't know what NetStrem.Play.Failed means either…

Then I ran into stack overflow, with the suggestions of using mplayer and vlc, I ran, respectively:

    $ mplayer -dumpstream rtmp://flash.dce.harvard.edu/bounce/mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4

got back

    MPlayer svn r34540 (Ubuntu), built with gcc-4.7 (C) 2000-2012 MPlayer Team
    mplayer: could not connect to socket
    mplayer: No such file or directory
    Failed to open LIRC support. You will not be able to use your remote control.

    Playing rtmp://flash.dce.harvard.edu/bounce/mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4.
    libavformat version 53.21.0 (external)
    Mismatching header version 53.19.0
    Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
    Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
    [rtmp @ 0x7f3de47abc00]Server error: Read access denied for stream 2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4.
    Failed to open rtmp://flash.dce.harvard.edu/bounce/mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4.


    Exiting... (End of file)

and

    $ vlc -I dummy vlc -I dummy rtmp://flash.dce.harvard.edu/bounce/mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4 --sout file/ts:output.mpg vlc://quit

with

    VLC media player 2.0.4 Twoflower (revision 2.0.3-289-g6e6100a)
    [0xf0aed8] dummy interface: using the dummy interface module...
    Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
    Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
    [rtmp @ 0x7f6f28010a20] Server error: Read access denied for stream 2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4.
    [0x7f6f28002d38] access_avio access error: Failed to open rtmp://flash.dce.harvard.edu/bounce/mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4: Input/output error
    [0x7f6f20000b28] main input error: open of `rtmp://flash.dce.harvard.edu/bounce/mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4' failed
    [0x7f6f20000b28] main input error: Your input can't be opened
    [0x7f6f20000b28] main input error: VLC is unable to open the MRL 'rtmp://flash.dce.harvard.edu/bounce/mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4'. Check the log for details.
    [0x7f6f28002a08] idummy demux: command `quit'

in response.

I've also tried Orbit Download on Windows with zero joy. The downloading wouldn't even start!

Would someone nicely tell me why it is so hard to download such kind of files and what those error messages mean? And is there any way that I can watch those lectures locally?

Best Answer

Use RtmpSrv

rtmpdump -r rtmp://flash.dce.harvard.edu/bounce -C B:0 -C Z: \
-C S:/2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4 \
-C S:BounceAPI3.0 -C N:0.000000 -C S:mp4 \
-y mp4:2012/02/22872/L01/22872-20120124-L01-1-h264-av1248-16x9-852x480.mp4 \
-o a.flv
RTMPDump v2.4-84-gdd57cd0
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Starting download at: 0.000 kB
[...]
3322.127 kB / 22.03 sec (0.3%)

Edit: please do not ask me about this answer anymore. I was booted from the RTMP community many years ago and dont wish to revisit that. This answer only exist for historical reason and cannot be deleted.

Related Question