[LINK] downloading YouTube videos

andrew clarke mail at ozzmosis.com
Sat Jan 19 11:54:01 AEDT 2008


On Sat, Jan 19, 2008 at 08:20:38AM +1100, Craig Sanders wrote:

> another reason this is relevant to Link is the disturbing fact that the
> video is only available as a flash movie hosted on youtube. i.e. it's a
> program that you have to run rather than just video data in a file which
> can be played by any video player program (any player that has the right
> video codecs, of course).

On FreeBSD there is no reliable way to execute Flash applets, so I use
youtube-dl, a Python script for downloading YouTube movies, and the open
source MPlayer to view them.  youtube-dl and MPlayer will also run under
Windows.

[1] http://www.freebsd.org/
[2] http://www.arrakis.es/~rggi3/youtube-dl/
[3] http://www.mplayerhq.hu/

11:09 ozzmosis at blizzard [~/tmp]youtube-dl "http://www.youtube.com/watch?v=zORv8wwiadQ"
Retrieving video webpage... done.
Extracting URL "t" parameter... done.
Requesting video file... done.
Video data found at http://74.125.14.25/get_video?video_id=zORv8wwiadQ&origin=ash-v42.ash.youtube.com
Retrieving video data: 100.0% (  22.14M of 22.14M) at   74.72k/s ETA 00:00 done.
Video data saved to zORv8wwiadQ.flv

11:14 ozzmosis at blizzard [~/tmp]mplayer zORv8wwiadQ.flv
MPlayer 1.0rc2-3.4.6 (C) 2000-2007 MPlayer Team
CPU: Intel Celeron 2/Pentium III Coppermine,Geyserville (Family: 6, Model: 8, Stepping: 10)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Compiled with runtime CPU detection.

Playing zORv8wwiadQ.flv.
libavformat file format detected.
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
VIDEO:  [FLV1]  320x240  0bpp  29.917 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffflv] vfm: ffmpeg (FFmpeg Flash video)
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 22050 Hz, 2 ch, s16le, 8.0 kbit/1.13% (ratio: 1000->88200)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [oss] 22050Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 320 x 240 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [null] 320x240 => 320x240 Planar YV12
A:   3.3 V:   3.3 A-V: -0.038 ct:  0.139  99/ 99  3%  0%  1.0% 0 0
Exiting... (Quit)

11:15 ozzmosis at blizzard [~/tmp]uname -v
FreeBSD 6.2-RELEASE #0: Wed Sep 19 21:56:10 EST 2007     root at blizzard.dancer:/usr/obj/usr/src/sys/DELLGX150


> which means that you have to be willing to run unknown, untrustworthy,
> and untrustable executable programs in order to view it.

Yes, for Flash content, ultimately you're at the mercy of the "sandbox"
that the Flash plugin provides.

[...]

> (for those who don't know how bit torrent and similar p2p protocols
> work, every downloader also becomes an uploader - sharing the parts
> of the file they already have with others who don't have that part
> yet. they'll do that for at least as long as they're downloading for,
> and most torrent users will continue to 'seed' the file until they've
> uploaded at least twice as much as they have downloaded...some torrent
> sites enforce such a ratio, with others it works on an honour system)

There are a few issues with using BitTorrent as a distribution system,
which were encountered when podcasting began.  This isn't to say
torrents can't be used, but it might explain why it's not used by sites
such as YouTube.  Those that come to mind:

1. With current-day torrent clients it's difficult to stream content,
because seeders will usually share random segments of the stream, rather
than sequential segments.  There is new software to work around this
situation, eg. http://www.bittorrent.com/dna/streamingservices.html, but
it's not in widespread use.

2. "Every downloader also becomes an uploader" - there are legal risks
with this in terms of users unknowingly sharing copyrighted content
where they are not legally permitted to.

3. Uploading data from corporate networks (or universities) can be a
problem in terms of bandwidth consumption.  Most torrent clients have a
way to limit the bandwidth they use, but it has to be configured
manually by the user.

Regards
Andrew



More information about the Link mailing list