FLV steaming – server/client side
This is the shortest how-to ever. You won’t get any extra info, the idea is to install the whole scheme fast as possible and then spend some time reading docs for each separate module.
This is how to make HTTP FLV streaming using the JW FLV Media Player and the lighttpd web server.
Here we go:
1. Installation
Install the lighttpd server. I am using Ubuntu, so i will install it via the apt-get package system:
sudo apt-get install lighttpd
2. Configuration
The first we have to do is change the default listening port to 81 (optional if you are already using apache on the same host, or whatever you decide to use) and enable the needed for flv streaming modules (mod_flv_streaming and mod_secdownload ). Edit the following file : /etc/lighttpd/lighttpd.conf and change the server.modules and the server.port parameters:
-
server.modules = (
-
"mod_access",
-
"mod_alias",
-
"mod_accesslog",
-
"mod_compress",
-
# "mod_rewrite",
-
# "mod_redirect",
-
# "mod_status",
-
# "mod_evhost",
-
# "mod_usertrack",
-
# "mod_rrdtool",
-
# "mod_webdav",
-
# "mod_expire",
-
"mod_flv_streaming",
-
"mod_secdownload", ## optional
-
# "mod_evasive"
-
)
-
flv-streaming.extensions = ( ".flv")
and
-
## bind to port (default: 80)
-
server.port = 81
Then start the lighttpd server ( Ubuntu )
sudo /etc/init.d/lighttpd start
3.1 Converting regulat video clips into .flv
Before compiling the ffmpeg binary, you have to download and install some development libraries. Please install liblame-dev and libvorbis-dev and all their dependencies:
apt-get install liblame-dev
apt-get install libvorbis-dev
Then go to your favorite source folder and download there the current svn server of ffmpeg
cd /usr/local/src/
If you don’t have subversion installed:
apt-get install subversion
Download the source code:
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
Open the downloaded directory:
cd ffmpeg/
and compile the ffmpeg binary with the following keys
make
Wait a lot of time …
and finally install it :
make install
2. Converting movies
Lets create two separate folders for “ready to be streamed movies” and “unconverted movies”
mkdir /var/www/movies/
mkdir /var/www/movies/convert_me/
mkdir /var/www/movies/flv/
Copy a favorite movie or clip in /var/www/movies/convert_me/ and then execute:
3.2 FLV files
You have to prepare your flv for streaming. I am not really a video encoding/decoding guru, so i am sharing my solution to the problem, but i am not sure it is the best possible.
Install flvtool2:
sudo apt-get install flvtool2
Put some flv movie somewhere inside your DocumentRoot folder ( for example /var/www/path/clip.flv) and then use the flvtool2 to generate the needed for the server meta-tags inside your flv video.
flvtool2 -U -p /var/www/path/clip.flv
Here i am using two keys :
-U Updates FLV with an onMetaTag event
-p Preserve mode only updates FLVs that have not been processed before
another interesting switch for whole folders will be :
-r Recursion for directory processing
As you may notice, the flvtool2 don’t have so many options at all, so it will be good to make a little more research about the features of this tool.
You can test the generated meta tags using the debug command in flvtool2.
flvtool2 -D clip.flv
Be prepared for a lot of output… It looks like this :
-
#1 Meta Tag (onMetaData): timestamp 0, size 7910, data size 7899
-
#2 Audio Tag: timestamp 0, size 274, data size 263
-
#3 Audio Tag: timestamp 26, size 274, data size 263
-
#4 Video Tag (Keyframe): timestamp 38, size 39766, data size 39755
-
#5 Audio Tag: timestamp 52, size 274, data size 263
-
#6 Video Tag (Interframe): timestamp 71, size 5289, data size 5278
-
#7 Audio Tag: timestamp 78, size 274, data size 263
-
#8 Audio Tag: timestamp 104, size 274, data size 263
-
#9 Video Tag (Interframe): timestamp 105, size 4334, data size 4323
-
#10 Audio Tag: timestamp 130, size 274, data size 263
Now your clip.flv is ready to be streamed.
4. FLV Client Player
Download the JW FLV Media Player from http://www.jeroenwijering.com/ and unpack the archive somewhere in your www directory. Create a html file in the same directory as your player with the following source:
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<title>JW Player for Flash</title>
-
</head>
-
<body>
-
<div id="container"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
-
<script type="text/javascript" src="swfobject.js"></script>
-
<script type="text/javascript">
-
var s1 = new SWFObject("player.swf","ply","328","200","9","#FFFFFF");
-
s1.addParam("allowfullscreen","true");
-
s1.addParam("allowscriptaccess","always");
-
s1.addParam('wmode','opaque');
-
s1.addParam('flashvars','file=http://your_lighttpd_server.com:81/path/clip.flv&streamer=lighttpd');
-
s1.write("container");
-
</script>
-
</body>
-
</html>
Save it as test_stream.html and open it with your web browser ( http://your_lighttpd_server.com:81/path/mediaplayer/test_stream.html). If your paths are correct you will be able to watch your clip.flv with the flv player.
In this example i am using the same server (lighttpd) for hosting the flv player and the clip, but it is possible another webserver to be used. For example you can host your site on Apache and use lighttpd only for storing the streamed videos!

5. Some technical information to help you understand the idea
Let’s take more detailed view of the JW Player’s configuration:
-
s1.addParam('flashvars','file=http://your_lighttpd_server.com:81/path/clip.flv&streamer=lighttpd');
Whe have two parameters:
file = link to the flv file we want to stream
streamer = lighttpd
With the second parameter we are activating the native flv stream support in the lighttpd server. After you start the playback of the video and forward to a spot that has not been downloaded yes, you will notice that another parameter will be passed to the flv file :
start = # of frame to start (here is where the meta tags we generated with flvtool2 are used to index the frames in the flv file). The lighttpd parse all the requests to the flv file and starts the streaming from the requested frame.

That’s all folks.
For more info, here is where i got the info for this mini-how-to from:
http://www.jeroenwijering.com/?item=JW_FLV_Media_Player
http://www.jeroenwijering.com/?item=HTTP_Video_Streaming
http://www.inlet-media.de/flvtool2
http://blog.lighttpd.net/articles/2006/03/09/flv-streaming-with-lighttpd
Важно!
Hola,
Поради ред причини и най-главно SPAM!!! реших да преместя mindmist.com на самостоятелен сървър. През милионите години направих на много хора мейли тук, затова сега ще помоля всеки който има активен мейл и иска да го запази да ми пише на angel[a]mindmist.com за да мога да му прехвърля всички папки, мейли и там още каквито глупости е събирал да в кутията си да ми пълни съвръра, на новия хост. Пак повтавям – да ми напише мейл, не в skype, icq, sms или телеграма. Да кажем, че не искам да се ангажирам с конкретна дата, но вече съм взел новата машина и сега остава само да я инсталирам и тествам. За да съм 100% сигурен, че ще намеря време и воля – нека датата е 1ви Декември 2008 .Нека силата е с вас !

– Ангел
Host
Picture of a creature, that i met during my last travel with a bulgarian train. Scary and aggressive one
Some funny draws that some people made the last month at my place
Visitor
OpenOffice 3 with native Aqua interface !
I used to use NeoOffice on my mac, because i really got nervios watching the pending X Server icon in my Dock. Now i saw that the latest beta of OpenOffice supports the native Aqua Graphic Server. I already removed NeoOffice. Native is always better
This is the way it looks like (nice and native) :
It’s time for useless toys again :)
Sometimes i just need to buy some gadget. After some time wasted what i don’t need, but want to own… I got this toy : Wacom Bamboo One (CTF-430). It’s pretty cool, pity that i can’t draw at all
Btw. if you spend some time with it in Photoshop, you will start convincing yourself that you maybe can draw.. like i did, but this won’t be true … Anyway … it’s a cool toy to own. It follows very exact each move of your hand and after 10 minutes you will have the feeling that you are actually drawing right on your screen. It comes with drivers and some applications for Windows and OSX and i tested it under Linux – it works!
When can you be sure, that you are already braindamaged ?!
I just made a small list of things that i am doing mindless from years:
- You are surfing in Internet with Firebug turned on and even pay attention to debug messages from random sites ?
- Sometimes you are even spending about 10-20 seconds debugging it ?
- After filling a html form you press Ctrl + S to save the output ?
- Sometimes you are viewing the sources of random pages to see which js framework are they using ?
- When you see a cool made page you are testing it in all possible browsers hoping to find a bug ?
Balls trippin’…
I can only advice you to watch the best South Park show ever – Major Boobage. You can find it on southparkstudios.com !
Do you feel like cheesing, guys ?

Napster! Mistake or yes ?
I was really happy the first days, but now i am wondering – “What the fuck, do i have to do with the shit called WMA / DRM. There are a lot of solutions in internet, but you have to pay for them. Maybe an account in iTunes was a better idea, but there is no flatrate feature at all.
There is another issue. As a Mac user i need a way to play all the music in Leopard too, but there is no way. Fuck !
I found some solutions, but they are way to complicated to be used without pissing me off during the procedure. Maybe i have to write a small script using the package of binaries coming with MPlayer


