Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_mp4_module.xml @ 271:4c6d2c614d2c
Cleaned up XML tag mess:
- all of <parameter> and <code>, and some of <dirname>, <value>,
and <command> were replaced by <literal>;
- the rest of <dirname> were replaced by links;
- <argument> were replaced by <value>;
- <value> is now rendered in HTML in italic;
- <literal> and <path> can now contain <value>.
Cleaned up terminology mess:
- directives take "parameters".
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Fri, 23 Dec 2011 17:29:59 +0000 |
parents | 0188d11c77dd |
children | be54c443235a |
comparison
equal
deleted
inserted
replaced
270:945d7299c26c | 271:4c6d2c614d2c |
---|---|
7 lang="en"> | 7 lang="en"> |
8 | 8 |
9 <section id="summary"> | 9 <section id="summary"> |
10 | 10 |
11 <para> | 11 <para> |
12 The module <code>ngx_http_mp4_module</code> provides pseudo-streaming | 12 The module <literal>ngx_http_mp4_module</literal> provides pseudo-streaming |
13 server-side support for H.264/AAC files typically having filename extensions | 13 server-side support for H.264/AAC files typically having filename extensions |
14 <path>.mp4</path>, <path>.m4v</path>, and <path>.m4a</path>. | 14 <path>.mp4</path>, <path>.m4v</path>, and <path>.m4a</path>. |
15 </para> | 15 </para> |
16 | 16 |
17 <para> | 17 <para> |
18 Pseudo-streaming works in alliance with conforming Flash players. | 18 Pseudo-streaming works in alliance with conforming Flash players. |
19 A player sends an HTTP request to the server with a start time | 19 A player sends an HTTP request to the server with a start time |
20 argument in the request URI’s query string (named simply | 20 argument in the request URI’s query string (named simply |
21 <parameter>start</parameter> | 21 <literal>start</literal> |
22 and specified in seconds), and the server responds with a stream | 22 and specified in seconds), and the server responds with a stream |
23 so that its start position corresponds to the requested time, | 23 so that its start position corresponds to the requested time, |
24 for example: | 24 for example: |
25 <example> | 25 <example> |
26 http://example.com/elephants_dream.mp4?start=238.88 | 26 http://example.com/elephants_dream.mp4?start=238.88 |
37 </para> | 37 </para> |
38 | 38 |
39 <para> | 39 <para> |
40 To start playback, a player first needs to read metadata. | 40 To start playback, a player first needs to read metadata. |
41 This is done by sending a special request with the | 41 This is done by sending a special request with the |
42 <parameter>start=0</parameter> | 42 <literal>start=0</literal> |
43 argument. Many encoding software will insert the metadata at | 43 argument. Many encoding software will insert the metadata at |
44 the end of the file. This is bad for pseudo-streaming: | 44 the end of the file. This is bad for pseudo-streaming: |
45 the metadata needs to be located at the beginning of the file, | 45 the metadata needs to be located at the beginning of the file, |
46 or else the entire file will have to be downloaded before it | 46 or else the entire file will have to be downloaded before it |
47 starts playing. If a file is well-formed (with metadata at the | 47 starts playing. If a file is well-formed (with metadata at the |
56 rather than having nginx do this on every such request. | 56 rather than having nginx do this on every such request. |
57 </para> | 57 </para> |
58 | 58 |
59 <para> | 59 <para> |
60 For a matching request with a non-zero | 60 For a matching request with a non-zero |
61 <parameter>start</parameter> | 61 <literal>start</literal> |
62 argument, nginx will read metadata from the file, prepare the | 62 argument, nginx will read metadata from the file, prepare the |
63 stream starting from the requested offset, and send it to a client. | 63 stream starting from the requested offset, and send it to a client. |
64 This has the same overhead as described above. | 64 This has the same overhead as described above. |
65 </para> | 65 </para> |
66 | 66 |
67 <para> | 67 <para> |
68 If a matching request does not include the | 68 If a matching request does not include the |
69 <parameter>start</parameter> | 69 <literal>start</literal> |
70 argument, there is no overhead, and the file is just sent as a static resource. | 70 argument, there is no overhead, and the file is just sent as a static resource. |
71 Some players also support byte-range requests, and thus do not require | 71 Some players also support byte-range requests, and thus do not require |
72 this module at all. | 72 this module at all. |
73 </para> | 73 </para> |
74 | 74 |
75 <para> | 75 <para> |
76 This module is not built by default, it should be enabled with the | 76 This module is not built by default, it should be enabled with the |
77 <code>--with-http_mp4_module</code> | 77 <literal>--with-http_mp4_module</literal> |
78 configuration parameter. | 78 configuration parameter. |
79 <note> | 79 <note> |
80 If you were using the third-party mp4 module, be sure to disable it. | 80 If you were using the third-party mp4 module, be sure to disable it. |
81 </note> | 81 </note> |
82 </para> | 82 </para> |
117 | 117 |
118 </directive> | 118 </directive> |
119 | 119 |
120 | 120 |
121 <directive name="mp4_buffer_size"> | 121 <directive name="mp4_buffer_size"> |
122 <syntax><argument>size</argument></syntax> | 122 <syntax><value>size</value></syntax> |
123 <default>512K</default> | 123 <default>512K</default> |
124 <context>http</context> | 124 <context>http</context> |
125 <context>server</context> | 125 <context>server</context> |
126 <context>location</context> | 126 <context>location</context> |
127 | 127 |
131 | 131 |
132 </directive> | 132 </directive> |
133 | 133 |
134 | 134 |
135 <directive name="mp4_max_buffer_size"> | 135 <directive name="mp4_max_buffer_size"> |
136 <syntax><argument>size</argument></syntax> | 136 <syntax><value>size</value></syntax> |
137 <default>10M</default> | 137 <default>10M</default> |
138 <context>http</context> | 138 <context>http</context> |
139 <context>server</context> | 139 <context>server</context> |
140 <context>location</context> | 140 <context>location</context> |
141 | 141 |
142 <para> | 142 <para> |
143 During metadata processing, a larger buffer may become necessary. | 143 During metadata processing, a larger buffer may become necessary. |
144 Its size cannot exceed the specified <argument>size</argument>, | 144 Its size cannot exceed the specified <value>size</value>, |
145 or else nginx will return the server error | 145 or else nginx will return the server error |
146 <http-status code="500" text="Internal Server Error"/>, | 146 <http-status code="500" text="Internal Server Error"/>, |
147 and log the following: | 147 and log the following: |
148 <example> | 148 <example> |
149 "/some/movie/file.mp4" mp4 moov atom is too large: | 149 "/some/movie/file.mp4" mp4 moov atom is too large: |