Allright, I started thinking of a streaming video framework.
How does this sound? Every user on the site (or at least those authorized somehow) has an access to a "control panel", somewhat similar to the "rate movies" framework, where they can select movies (from the selection of all movies on the site) and specify which movies they have on their own server, and add the streaming URL for that particular movie? They would be allowed to enable / disable it at at any time, to conserve their bandwidth caps, and the site would choose sites from the pool to stream from. Those sites only need to have the backend to provide FLV files ― either with direct access or through a script that allows seeking (included below). Naturally, they must acquire the FLV files (e.g. download or encode) somehow.
This is the database change, gives some idea what kind of framework this would be (for those who know how to read it):
CREATE TABLE movie_streaming
(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
movieid INT NOT NULL, KEY m(movieid),FOREIGN KEY(movieid)REFERENCES movie(id)ON DELETE CASCADE ON UPDATE CASCADE,
userid INT NOT NULL, KEY u(userid),FOREIGN KEY(userid)REFERENCES users(id)ON DELETE CASCADE ON UPDATE CASCADE,
# What is the user's opinion of this stream's availability?
user_enabled ENUM('N','Y') NOT NULL DEFAULT 'N',
user_modtime INT NOT NULL DEFAULT 0,
# What does the TASVideos server think of this user's server?
# This decision overrides user_enabled when user_enabled='Y'.
# TASVideos should automatically verify the user's server
# periodically to see if it still supplies conforming stream
# at an adequate kB/s rate.
server_enabled ENUM('N','Y') NOT NULL DEFAULT 'N',
server_modtime INT NOT NULL DEFAULT 0,
# Classes:
# M = authentic movie
# C = commentary
# H = movie with camera hack
# T = trick video of some interest
# O = auxiliary video of some other kind (comparisons, etc.)
class ENUM('M','C','H','T','O') NOT NULL DEFAULT 'M',
# The streaming URL access point.
# A $ in the URL will be substituted with the starting position.
streaming_url VARCHAR(255) NOT NULL,
# Description for this particular video stream pertaining to this movie
description TEXT NOT NULL DEFAULT '',
# length in seconds
length DECIMAL(10,3) NOT NULL DEFAULT 0.000,
# size in bytes
filesize INT(11) NOT NULL,
# width and height
width SMALLINT NOT NULL DEFAULT 256,
height SMALLINT NOT NULL DEFAULT 224
);
This is the PHP script that allows seeking:
<?php
$pos = (int)$_GET['start'];
$name = (string)$_GET['v'] . '.flv';
if(ereg('[/+^*?\\\\]', $name) || !file_exists($name))
{
header('HTTP/1.0 404 NOT FOUND');
die("{$_GET['v']} not found");
}
$len = filesize($name);
if($pos != 0) $len = $len - $pos + (3+2+4+4);
$fh = @fopen($name, 'rb');
if(!$fh)
{
header('HTTP/1.0 403 PROBLEM');
die("{$_GET['v']} has a problem");
}
header('Connection: close');
header('Content-Type: video/x-flv');
header('Content-Length: '. $len);
if($pos != 0) print "FLV\1\1\0\0\0\11\0\0\0\11";
fseek($fh, $pos);
while (!feof($fh)) print fread($fh, 65536);
fclose($fh);
If it were installed as "flv_stream.php", the access point URI would be, for example,
"http://www.w-create.com/~bisqwit/nesvideos/flv_stream.php?v=qkpqeigpqig&start=$".
In the movie entries on the website, all enabled streaming video entries would be listed for that particular movie, and the user could start viewing one of them at time.
There's still the open question as for who encodes those movies, but the idea behind this is that most of the work is delegated to volunteers, and the threshold to become a stream provider would be low.