FLV Video Players

One of the most obvious areas in which Indy sites currently suck is in the lack of widespread use of FLV-based video players. In the modern world (as opposed to on our sites), people generally expect that any uploaded video will be converted on the server so it's available within the site fairly quickly as a bit of Flash video.

There are three parts to any FLV video solution, namely uploading, conversion, and playback.

Uploading

Large file uploads can take a really long time (obviously). Is there a good way to deal with this in PHP? Does a file upload lock up our application for any appreciable length of time?

Conversion

Because it can take a really long time to convert video on the server, it's generally considered smart to separate the conversion process from the HTTP request that uploaded it. Basically, instead of the web application doing the conversion as part of the upload request (which could take, let's say, a minute or two of processing), the best way is to spawn a separate process to convert the video so that the web app can happily say "thanks for your upload" and move onto the next request without timing out.

In Rails, there is a thing called BackgroundRb which allows us to easily spawn new worker processes to take care of background processing tasks (such as video conversion). The really nice thing about it is that it automatically queues requests, so if ten people upload videos all at the same time (or one person uploads ten videos), it'll process them one at a time. I'll look around and see if I can find anything similar for PHP.

There is a nice-looking interface to the ffmpeg video conversion utility at http://ffmpeg-php.sourceforge.net/ It doesn't get around the question of process-spawning and queuing, but it does offer a nice-looking control API.

Playback

I'm quite decent with Flash and can turn out a video player that will look nice. There are a few things to consider.

  • There is a Free Software flash player available from the FSF. It's called Gnash. I've never tried it out, but apparently it is supposed to be able to play Flash 7 video.
  • The current Flash standard is like Flash 9. Videos encoded for these newer versions is incompatible with Flash 7.
  • Flash 8 and 9 video players are incompatible with Gnash but they can play Flash 7 video (which is all that FFmpeg actually encodes).
  • Flash 8 and 9 have much nicer-looking players available, and it's a big pain in the ass to skin the Flash 7 player or build an advanced one that'll work.

In general if there are no objections I'd say that it'd be easiest to do up a nice-looking video player in Flash 8 format and wait for Gnash to catch up (that is, if this FLV video thing is something people do want to implement).

Alternatives

If people think it's a good idea, we could alternatively try implementing an open source video player, like these ones:

(note from startx: i tried cortado several times some month ago, and it constantly crashed my iceweasal on debian. meanwhile it seems much better, however the interface is very simple in comparison to a flv player, but i guess a good java coder could skin/improve that applet)

(note from simon: The mediaframe applet took more than a minute to load. As much as I'd prefer a Java solution over Flash, this isn't 'video on demand'.)