ELM 2007/11/5 23:46
Flash Video (FLV) Streaming With Nginx
I was looking forward for this feature for last 3 months! And at last, it is [url=http://sysoev.ru/nginx/docs/http/ngx_http_flv_module.html]there[/url]! Now, [url=http://nginx.net/]nginx[/url] works on our streaming servers perfectly and flv streaming will not be Lighttpd’s unique feature anymore. [img]http://blog.kovyrin.net/wp-includes/images/smilies/icon_smile.gif[/img]This post is about how to use new Nginx module http_flv_moduleintroduced in 0.4.7 (but there was a bug in its implementation, thatcan be fixed with [url=http://blog.kovyrin.net/files/flv_fix.patch]my patch[/url]) and made completely perfect in 0.4.8.
First of all, to use new module, you should (re)complile nginx with [b]–with-http_flv_module[/b] option:[code]# ./configure --with-http_flv_module ...SOME-OTHER-OPTS...[/code]Next your action should be activation of flv streaming module for your flv files in nginx.conf:
[font=monospace][code]...
http {
...
server {
...
location ~ \.flv$ {
flv;
}
...
}
...
}[/code][/font]
This option will instruct nginx to add special “header” informationto data stream if user asked for some flv file and passed parameter“?start=XXX”, which means “give me that flv file from byte XXX to theend of file” (this is the idea of flv streaming).
Last your action, if it was not done before, should be conversion ofyour video files to FLV format and adding meta info to your created flvfiles. You can read how to do it in [url=http://blog.kovyrin.net/2006/10/08/lighttpd-memcoder-flvtool-for-streaming/]my previous post[/url].
As always, I want to ask you, if you like this post, [url=http://digg.com/linux_unix/One_More_Open_Source_Tool_to_Kill_Youtube]support it on Digg.com[/url]
From: [url]http://blog.kovyrin.net/2006/10/14/flash-video-flv-streaming-nginx/[/url]