Hey,
according to the Flash Video (FLV) specification [1] E.2 & E.3, [2],
the correct format of the FLV header and the beginning of the stream is:
FLV\x01(\x01|\x04|\x05)\x00\x00\x00\x09\x00\x00\x00\x00
with 5th byte denoting presence of video (\x01), audio (\x04)
or both (\x05).
However, nginx is currently using:
FLV\x01\x01\x00\x00\x00\x09\x00\x00\x00\x09
and while denoting presence of only video tags (\x01) isn't strictly
incorrect, denoting presence of both audio and video (\x05) would match
"real world" usage much closer.
The real problem is \x00\x00\x00\x09 in the beginning of the stream
(denoting size of the previous tag), which is plainly wrong, because
according to the specification it should be always \x00\x00\x00\x00.
I'm aware of the fact that virtually all other pseudo-streaming modules
are using the same incorrect header, but that doesn't mean that nginx
must use it as well. Attached patch fixes this.
[1] http://www.adobe.com/devnet/f4v.html
[2] http://osflash.org/flv#flv_format
Best regards,
Piotr Sikora < piotr.sikora@frickle.com >
--- src/http/modules/ngx_http_flv_module.c.orig Thu Nov 17 17:53:11 2011
+++ src/http/modules/ngx_http_flv_module.c Thu Nov 17 17:53:29 2011
@@ -23,7 +23,7 @@
};
-static u_char ngx_flv_header[] = "FLV\x1\x1\0\0\0\x9\0\0\0\x9";
+static u_char ngx_flv_header[] = "FLV\x1\x5\0\0\0\x9\0\0\0\0";
static ngx_http_module_t ngx_http_flv_module_ctx = {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel