Homo-Adminus Blog

Yet Another Admin’s Blog

It will be really short post about using set of free tools to implement fully functional flash video streaming server. So, what we are going to get at the end of our setup? We are going to get some type of completely free streaming support that is available with Macromedia’s non-free Flash Communication Server (Flash Media Server) (FCS). 🙂

First our step as in any video streaming technology will be to prepare some videos for streaming by converting them to specific video format called “Flash Video” (flv) and adding some meta-information there to make stream rewind posible. There lots of small articles in Internet, that saying “just use ffmpeg tool and everything will be fine”, but I should say “no” to these articles authors. Ffmpeg sucks because it supports only small subset of input video formats and we don’t want to do any transcoding of original video to some video formats that ffmpeg can handle (it takes lots of resources, etc). So, my choice for video transcoding is really cool free software called mplayer, that has converting utility mencoder and can handle almost any original format and convert video file to flv format very quickly.

First of all you will need to get mplayer sources from mplayer we site and compile them. I will not describe how to do it because there are lots of articles about this process, but I want to get your attention to simple fact: Try to minimize set of disabled video codecs in compile time by installing all required libraries from your distribution repositories or from sources, because more codecs you will have, more videos you will be able to handle”.

When you’ve installed your mplayer/mencoder tools, you will need to install Ruby language interpreter to be able to run flvtool2 software. Please, ensure, that you have 1.8.4+ version of Ruby.

Next step is to install flvtool2 – tool, that allows us to inject meta-information to video files to make possible video stream rewinds in flash players. You can get it from its home page, but I would suggest you to install this software from SVN repository as described on its home page.

Small notice: current version of flvtool2 has really annoying bug, that prevents it from working with mencoder generated flv files. When you are trying to use it, you’ll get something like this:

Last thing you should do is to get Lighttpd web server from their site and install it. Then, enable flv-streaming module in its config and you’ll be able to use any flash player, that understands flash streaming idea to create your own Youtube and to get your our own billion of US dollars. 😉 And to thank author of this article, you can simply support it on digg.com.