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

24

17

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-16x9-852x480.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?

alxyzc

Posted 2013-01-06T05:59:28.163

Reputation: 365

as long as you don't distribute the video, you it should be fair to download it IMHO – CSᵠ – 2013-01-06T06:33:04.840

Did you check the response here: http://stackoverflow.com/questions/4808322/how-to-save-this-rtmp-flash-video-stream?rq=1

– d33pika – 2013-01-06T06:43:15.070

@godka haha as long as i can actually get to download it; – None – 2013-01-06T07:04:58.600

@d33pika actually no. seems like rtmpdump still is the powerful tool. i think it's the flags i failed to tweak with that didn't get the work done – None – 2013-01-06T07:06:24.927

Answers

15

Use RtmpSrv. It is bundled with rtmpdmp v.21 onwards:

As of 2.1 there are two additional server programs, rtmpsrv and rtmpsuck.

rtmpsrv is a stub for a server; it logs the connect and play parameters from a regular client that connects to it. It then invokes rtmpdump with those parameters to retrieve the stream.

Usage

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%)
  • -r - the url of the rtmp server. Find the url in the "connect" packet. E.g. connect('22773_VOD_HOP_NEW_2013') means your url will be rtmp://serveraddress/22773_VOD_HOP_NEW_2013

  • -y - the file location and type in the rtmp server of your video file. Found it in the "play" packet.

  • -o - the output filename. If it's an mp4 stream then use a .mp4 extension.

Steven Penny

Posted 2013-01-06T05:59:28.163

Reputation: 7 294

You are my hero! I was all troubled with the -C flag of the rtmpdump command. (I still failed to understand how I should tweak that, but it's working!) – alxyzc – 2013-06-13T08:06:41.260

4Care to explain what all the command line options are for, because it's not exactly clear to me – Ivo Flipse – 2013-06-25T12:38:30.600

11

Use the VLC player to download a rtmp stream:

  1. Step: Chose Media > Convert/Save (or use shortcut Ctrl + R)
  2. Step: Chose tab Network
  3. Step: Enter rmtp stream URI

    enter image description here

  4. Step: Chose Convert and enter target path/file
  5. Step: Go!

Gottlieb Notschnabel

Posted 2013-01-06T05:59:28.163

Reputation: 510

1

In regards to the legality that would depend on the restrictions set by the owner. But I would assume if it was just for personal use there wouldn't be much of an issue.

In regards to downloading them you should be able to use VLC. I haven't ever tried it myself but it lists support for the RTMP protocol and it's regular convert/save option should be able to save the steam to a file without any issue.

Dracs

Posted 2013-01-06T05:59:28.163

Reputation: 2 616

I Have tried that actually, with the result of VLC yelling at me with the following: Your input can't be opened: 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. btw, how do I check the log? – alxyzc – 2013-02-28T07:03:52.117

@alxyzc Tools > Messages. You may want to increase the verbosity in order to see all the debug messages. – bdr9 – 2013-03-28T21:46:51.460

1

I have had success with some RTMP streams using the youtube-dl program.

It's a command-line application which will download to your current directory if you pass it no arguments. With RTMP streams, I usually just pass it the page URL, rather than try to locate the RTMP URI.

youtube-dl "http://domain/page-with-stream"

palswim

Posted 2013-01-06T05:59:28.163

Reputation: 2 793

0

Streaming Video Downloader can do it - I use it to save all kidns of videos. Just tried it with your Harward lecture and it worked. It's not freeware but it can do it.

You may have to refresh the webpage a couple of times though for the video to be picked up.

Disclosure: I was part of the dev team for this product.

George

Posted 2013-01-06T05:59:28.163

Reputation: 282

0

As a Harvard undergrad, I'm used to watching lectures in 2x or higher (a habit from CS50), and it's a bother that Extension school videos don't have this feature.

I've found that Jaksta (you can probably find a free copy online somewhere) pretty successfully downloads streaming lectures in FLV format, which I then can watch in VLC player at any speed to my heart's content.

Once I've got the first lecture downloaded, I can get the next lectures downloading in a separate desktop while I watch the first. I found this solution after perusing all these forums and not really understanding how to implement on Mac OS the RMTP solution that was posted above.

Jonathan

Posted 2013-01-06T05:59:28.163

Reputation: 1