Post subject: TASVideos and video streaming (flash videos)
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Comicalflop wrote:
Bisqwit wrote:
Flash video of Final Fantasy IV WIP
This is an immensely interesting feature. Can this be done with any and all published videos?
Technically yes. However, for TASVideos being able to serve those for the public audience (the WIP audience is fortunately rather limited), I would need an upstream over ten times larger than I currently have (around 20 Mbit/s total would be required). I am currently mapping out possibilities. Do we have people who could contribute upstream bandwidth? They would be required to run a simple dedicated webserver with a short script written in PHP (or some other language). Naturally, the server should be stable and able to provide at least an 40 kB/s upload rate. And of course, to store the FLV files being streamed. (10 to 300 megabytes per instance.) Also, the Flash player on that page is a rip+hack of Youtube's, which they likely don't condone. We would need a freely distributable one. There's Youtube of course, but Youtube has 10 minute limits. And Google Videos, but I'm not familiar with their terms of service, and whether they can be embedded.
Post subject: Re: Flash videos in general
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
For reference, I link to two other threads discussing a related topic... ― http://tasvideos.org/forum/t/3362: Google videos ― http://tasvideos.org/forum/t/5638: Youtube
Post subject: Re: TASVideos and video streaming (flash videos)
Senior Moderator
Joined: 8/4/2005
Posts: 5777
Location: Away
Bisqwit wrote:
Do we have people who could contribute upstream bandwidth?
AngerFist! He always encourages people to rape his upload bandwidth. :P
Warp wrote:
Edit: I think I understand now: It's my avatar, isn't it? It makes me look angry.
Post subject: Re: TASVideos and video streaming (flash videos)
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
moozooh wrote:
AngerFist! He always encourages people to rape his upload bandwidth. :P
Yeah, I'm already talking with AngerFist, but it remains to be seen whether he could provide a service that supports running that script. Without the script, the videos can still be watched but cannot be seeked without downloading the entire thing.
Post subject: Re: TASVideos and video streaming (flash videos)
Former player
Joined: 7/21/2006
Posts: 747
Location: Northern Hemisphere
AKA wrote:
The only limit that universally applies to everyone is the 100mb upload.
Actually, they have a little upload thing that lets you upload up to a gig (I think) of video, but still only 10 minutes...it's either any amount of time and under 100 gigs, or vice versa. (EDIT: cancel out the "above 10 minute" part) Anyway, this feature is kickass! Is the encoding done automatically? If so, how long does it take? Under the current circumstances, what would be the maximum amount your upstream could take?
Post subject: Re: TASVideos and video streaming (flash videos)
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
mr_roberts_z wrote:
Anyway, this feature is kickass! Is the encoding done automatically? If so, how long does it take? Under the current circumstances, what would be the maximum amount your upstream could take?
As I said, the FF4 case is an exception, it does not happen automatically. I did it manually, for fun. At maximum, I can sustain streaming videos like these to two† clients at the same time, provided the video is encoded at as low quality as this is.‡ However, the quality is too low for my preference; I'd want a significantly better quality ― which would drop my sustainable simultaneous client amount to about 1. I've estimated that the number of supported simultaneous clients would have to be around 30. Encoding could happen automatically for those emulators which are currently autoscreenshotted (fceu, snes9x, vba, dega, excluding gens). I'd estimate it'd take about 4…10 minutes per each minute of the movie, assuming a multipass encoding and file transfer delays. _______________ ‡) This particular video is however hosted on another server that has better resources, so the limit is higher than two, but that is an exception; I cannot count it as resources for certain reasons. †) Four in an optimal situation, but optimal situations almost never happen.
Joined: 10/15/2007
Posts: 685
I'd be happy to lend my webserver to the task, by the way. My plan has 50 GB of allotted disk space, and is supposedly 'unmetered', which is hopefully true. I suppose I'll find out, won't I? Edit: Failing that, I can just use my desktop as a server. It's always on, and I have an 80kB/sec upstream that's typically doing nothing.
Kirby said so, so it must be true. ( >'.')>
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
superjupi wrote:
I'd be happy to lend my webserver to the task, by the way. My plan has 50 GB of allotted disk space, and is supposedly 'unmetered', which is hopefully true. I suppose I'll find out, won't I?
That tells the amount of storage (50 GB) and the amount of data the can be transmitted (unlimited?), but not 1a) whether you can run a web server 1b) whether you can have webpages and whether the site supports PHP (cgi would also be cool) 2) how fast upload those said webpages can have (i.e. how fast can one download from those pages).
Joined: 10/15/2007
Posts: 685
Upstream isn't a problem for the webserver, and in the case of my desktop, I'd just have to reinstall Apache and PHP.
Kirby said so, so it must be true. ( >'.')>
Joined: 5/17/2007
Posts: 393
Location: Sweden
I smell sarcasm, oh that streaming thing sounds fun. Can't help out though...
"No love for the game gear"
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
As another thing, it appears that mencoder's FLV encoding (as of MEncoder dev-SVN-r24130-4.1.3) is not entirely robust yet; during encoding, it complained a couple of times that it "cannot write a frame", and consequently, there is some corruption seen in that movie. (Remains to be seen whether dev-SVN-r25380-4.2.3 works better.) For reference, the command used to encode the FLV was like this:
mencoder \
        ~/nes/snes/test0.avi \
        -endpos 53:15 \
        -o ff4wip53min.flv \
        -of lavf -lavfopts format=flv \
        -oac mp3lame -af resample=22050 -lameopts preset=30:aq=0 \
        -ovc lavc \
        -lavcopts vcodec=flv:vqscale=9:mbd=2:trell:cbp:v4mv:cmp=6:precmp=3:\
dia=-3:predia=-4:vb_strategy=1:preme=2:vpass=<pass number>
Repeated for each vpass. After that, flvdmi.exe is run to add the index metadata into the file.
Skilled player (1827)
Joined: 4/20/2005
Posts: 2161
Location: Norrköping, Sweden
I have heard that the codec used when encoding .avi files to FLV isn't very good compared to newer codecs, such as H264 (I don't know if this is true, it's just what I've heard). Would it be possible to encode .avi files into FLV using H264 codec to increase the quality/filesize ratio? Sorry if this is a silly question, I don't know much about these things...
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Randil wrote:
I have heard that the codec used when encoding .avi files to FLV isn't very good compared to newer codecs, such as H264 (I don't know if this is true, it's just what I've heard). Would it be possible to encode .avi files into FLV using H264 codec to increase the quality/filesize ratio? Sorry if this is a silly question, I don't know much about these things...
Flash 9 supports H.264, earlier versions don't. Mencoder does not support putting H.264 streams into a FLV container yet.
Post subject: Re: TASVideos and video streaming (flash videos)
Banned User
Joined: 12/5/2007
Posts: 742
Location: Gone
And then there's MegaVideo, a sister site for Megaupload. So far, there are no 10-minute limits there.
bisqwit wrote:
There's Youtube of course, but Youtube has 10 minute limits. And Google Videos, but I'm not familiar with their terms of service, and whether they can be embedded.
ventuz
He/Him
Player (125)
Joined: 10/4/2004
Posts: 940
might be offtopic but I thought I'd suggest it... Stage6 It's a very good embed movie player Pro 1. Plays movie at high reso 2. No upload limit (I think? they even have 3.8 hours movie) 3. Plays movie smoothly, even at fullscreen (at least for me, other embed movie player like flash lags my machine) 4. You can embed video (I remember trying to view embed Stage6 movie, they were crashy, but I haven't tried lately since the new updates) Con 1. You would have to encode/convert movie into divX in order to be able to upload there. (converting tool is supposely free, they have detail on their site) 2. Install "DivX Webplayer" plugin to view. Hmm... no other Con that I can think of.
Post subject: Re: TASVideos and video streaming (flash videos)
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
symbolic X wrote:
And then there's MegaVideo, a sister site for Megaupload. So far, there are no 10-minute limits there.
Ad-ridden. Consequently horrible use experience.
ventuz wrote:
Stage6 It's a very good embed movie player
Seems to require installation of specific plugins. Off-topic in this thread and out of scope of the project.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
A friendly bump. Summary so far: We could have streaming video at TASVideos (i.e. youtube like video embeds). I'm open for the option ― it would be acceptable only if we could provide it ourselves, and not depend on e.g. Youtube. We need: Contributors with servers! Minimum requirements: ― A few gigabytes of free disk space ― At least 10 Mbit/s upload speed ― Direct access to the files on HTTP, without any registration/html clickthisandthat steps ― That the uploaded videos don't magically expire without warning Recommended: ― At least 60 gigabytes of free disk space ― Ability to run PHP script (or CGI) (without this, the video stream cannot be seeked) ― At least 100 Mbit/s upload speed ― No daily/weekly/monthly transfer caps We have had zero volunteers so far. If however we could establish this framework, it would be nice if we had multiple contributors. This way, some load balancing could be done, and those with transfer limits could also participate. We need: Encoders Encoders who can re-encode any published AVI/MKV file to generate a streamable FLV file with index, and upload it to the server farm and update some kind of index that tells which servers have the file. We need: Streaming playing software (Flash) This is the least of the practical problems. At the minimal level, we can even rip Youtube's player as I have already done :P
Joined: 4/25/2004
Posts: 615
Location: The Netherlands
I can host 100mbit @ 80gig/week max for now.
qfox.nl
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
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.
Joined: 4/25/2004
Posts: 615
Location: The Netherlands
That sounds good except for the manual disabling. I can't keep tabs on the bandwidth 24/7 and when my cap is reached I want to disable the uploads completely until the next week starts. I think php can track bandwidth just fine. Whenever it feels it's gonna exceed the current limit it can finish whatever it's uploading, reject new connections, ping a notification to the master server, run a crontab to re-enable uploads next monday. Or something...
qfox.nl
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
qFox wrote:
I think php can track bandwidth just fine. Whenever it feels it's gonna exceed the current limit it can finish whatever it's uploading
Well, TASVideos cannot do that because it cannot keep track of how much traffic has been transferred from the user's server. The transfer requests are initiated with Flash, and even if they are bounced from a TASVideos server, that server can only know of the starting points, not of how many bytes were transferred. Enables/disables would have to come from the stream provider's side. EDIT: Actually there may be a bookkeeping mechanism, I recall youtube uses one. Needs investigation, and needs planning of how to bookkeep the transfer limits.
Joined: 4/25/2004
Posts: 615
Location: The Netherlands
No but the local server can. A local script can check this and act uppon it. Hence the ping back to the master server indicating no more connections are accepted for now.
qfox.nl
Post subject: Re: Call for action
arflech
He/Him
Joined: 5/3/2008
Posts: 1120
Bisqwit wrote:
We need: Streaming playing software (Flash) This is the least of the practical problems. At the minimal level, we can even rip Youtube's player as I have already done :P
This is the most-widely-used free Web-based FLV player: http://www.jeroenwijering.com/?item=JW_FLV_Media_Player
i imgur com/QiCaaH8 png
Banned User
Joined: 12/5/2007
Posts: 742
Location: Gone
What about frames per second? It loads up faster at 30 but it's slower at 60.
Former player
Joined: 12/5/2007
Posts: 716
Convince me to get myself a .to domain (I personally don't like servers without a proper second-level domain) and I'm all in. Encoding could be scripted, I guess: you either create a YT-like 200kbps-ish .flv file or one with the original bitrate (if bitrate <= 200k). /symbolic X: I think that it's "only" streaming content, 30fps should be enough. Unfortunately I have no idea as to how to accomplish this with mencoder.