Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_hls_module.xml @ 1168:384bb0349a8a
Documented the "if" parameter of the "access_log" directive.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Thu, 24 Apr 2014 12:25:59 +0400 |
parents | 4e20e4f8f49b |
children | 0ffd5caf0766 |
rev | line source |
---|---|
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
2 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
3 <!-- |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
4 Copyright (C) Nginx, Inc. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
5 --> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
6 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
8 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
9 <module name="Module ngx_http_hls_module" |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
10 link="/en/docs/http/ngx_http_hls_module.html" |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
11 lang="en" |
1142
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
12 rev="3"> |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
13 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
14 <section id="summary"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
15 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
16 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
953
diff
changeset
|
17 The <literal>ngx_http_hls_module</literal> module provides HTTP Live Streaming |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
953
diff
changeset
|
18 (HLS) server-side support for H.264/AAC files. |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
953
diff
changeset
|
19 Such files typically have the <path>.mp4</path>, <path>.m4v</path>, |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
953
diff
changeset
|
20 or <path>.m4a</path> filename extensions. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
21 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
22 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
23 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
953
diff
changeset
|
24 nginx supports two URIs for each MP4 file: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
25 <list type="bullet"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
26 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
27 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
28 The playlist URI that ends with “<literal>.m3u8</literal>” and accepts |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
953
diff
changeset
|
29 the optional “<literal>len</literal>” argument that defines the fragment length |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
30 in seconds; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
31 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
32 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
33 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
34 The fragment URI that ends with “<literal>.ts</literal>” and accepts |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
35 “<literal>start</literal>” and “<literal>end</literal>” arguments that |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
36 define fragment boundaries in seconds. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
37 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
38 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
39 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
40 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
41 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
42 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
43 <note> |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1115
diff
changeset
|
44 This module is available as part of our |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1115
diff
changeset
|
45 <commercial_version>commercial subscription</commercial_version>. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
46 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
47 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
48 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
49 </section> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
50 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
51 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
52 <section id="example" name="Example Configuration"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
53 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
54 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
55 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
56 location /video/ { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
57 hls; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
58 hls_fragment 5s; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
59 hls_buffers 10 10m; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
60 hls_mp4_buffer_size 1m; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
61 hls_mp4_max_buffer_size 5m; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
62 alias /var/video/; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
63 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
64 </example> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
953
diff
changeset
|
65 With this configuration, the following URIs are supported for |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
66 the “<path>/var/video/test.mp4</path>” file: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
67 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
68 http://hls.example.com/video/test.mp4.m3u8?len=8.000 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
69 http://hls.example.com/video/test.mp4.ts?start=1.000&end=2.200 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
70 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
71 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
72 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
73 </section> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
74 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
75 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
76 <section id="directives" name="Directives"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
77 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
78 <directive name="hls"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
79 <syntax/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
80 <default/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
81 <context>location</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
82 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
83 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
953
diff
changeset
|
84 Turns on HLS streaming in the surrounding location. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
85 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
86 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
87 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
88 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
89 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
90 <directive name="hls_buffers"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
91 <syntax><value>number</value> <value>size</value></syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
92 <default>8 2m</default> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
93 <context>http</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
94 <context>server</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
95 <context>location</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
96 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
97 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
98 Sets the maximum <value>number</value> and <value>size</value> of buffers |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
953
diff
changeset
|
99 that are used for reading and writing data frames. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
100 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
101 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
102 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
103 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
104 |
1142
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
105 <directive name="hls_forward_args"> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
106 <syntax><literal>on</literal> | <literal>off</literal></syntax> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
107 <default>off</default> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
108 <context>http</context> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
109 <context>server</context> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
110 <context>location</context> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
111 <appeared-in>1.5.13</appeared-in> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
112 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
113 <para> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
114 Adds arguments from a playlist request to URIs of fragments. |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
115 This may be useful for performing client authorization at the moment of |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
116 requesting a fragment, or when protecting an HLS stream with the |
1147
ff7defe134d8
HLS: fixed fallouts in the previous edition.
Ruslan Ermilov <ru@nginx.com>
parents:
1142
diff
changeset
|
117 <link doc="ngx_http_secure_link_module.xml">ngx_http_secure_link_module</link> |
ff7defe134d8
HLS: fixed fallouts in the previous edition.
Ruslan Ermilov <ru@nginx.com>
parents:
1142
diff
changeset
|
118 module. |
1142
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
119 </para> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
120 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
121 <para> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
122 For example, if a client requests a playlist |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
123 <literal>http://example.com/hls/test.mp4.m3u8?a=1&b=2</literal>, |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
124 the arguments <literal>a=1</literal> and <literal>b=2</literal> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
125 will be added to URIs of fragments after the arguments |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
126 <literal>start</literal> and <literal>end</literal>: |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
127 <example> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
128 #EXTM3U |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
129 #EXT-X-VERSION:3 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
130 #EXT-X-TARGETDURATION:15 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
131 #EXT-X-PLAYLIST-TYPE:VOD |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
132 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
133 #EXTINF:9.333, |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
134 test.mp4.ts?start=0.000&end=9.333&a=1&b=2 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
135 #EXTINF:7.167, |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
136 test.mp4.ts?start=9.333&end=16.500&a=1&b=2 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
137 #EXTINF:5.416, |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
138 test.mp4.ts?start=16.500&end=21.916&a=1&b=2 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
139 #EXTINF:5.500, |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
140 test.mp4.ts?start=21.916&end=27.416&a=1&b=2 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
141 #EXTINF:15.167, |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
142 test.mp4.ts?start=27.416&end=42.583&a=1&b=2 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
143 #EXTINF:9.626, |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
144 test.mp4.ts?start=42.583&end=52.209&a=1&b=2 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
145 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
146 #EXT-X-ENDLIST |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
147 </example> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
148 </para> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
149 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
150 <para> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
151 If an HLS stream is protected with the |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
152 <link doc="ngx_http_secure_link_module.xml">ngx_http_secure_link_module</link> |
1147
ff7defe134d8
HLS: fixed fallouts in the previous edition.
Ruslan Ermilov <ru@nginx.com>
parents:
1142
diff
changeset
|
153 module, <var>$uri</var> should not be used in the |
1142
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
154 <link doc="ngx_http_secure_link_module.xml" id="secure_link_md5"/> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
155 expression because this will cause errors when requesting the fragments. |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
156 <link doc="ngx_http_map_module.xml" id="map">Base URI</link> should be used |
1147
ff7defe134d8
HLS: fixed fallouts in the previous edition.
Ruslan Ermilov <ru@nginx.com>
parents:
1142
diff
changeset
|
157 instead of <var>$uri</var> |
ff7defe134d8
HLS: fixed fallouts in the previous edition.
Ruslan Ermilov <ru@nginx.com>
parents:
1142
diff
changeset
|
158 (<var>$hls_uri</var> in the example): |
1142
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
159 <example> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
160 http { |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
161 ... |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
162 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
163 map $uri $hls_uri { |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
164 ~^(?<base_uri>.*).m3u8$ $base_uri; |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
165 ~^(?<base_uri>.*).ts$ $base_uri; |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
166 default $uri; |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
167 } |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
168 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
169 server { |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
170 ... |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
171 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
172 location /hls { |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
173 hls; |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
174 hls_forward_args on; |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
175 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
176 alias /var/videos; |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
177 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
178 secure_link $arg_md5,$arg_expires; |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
179 secure_link_md5 "$secure_link_expires$hls_uri$remote_addr secret"; |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
180 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
181 if ($secure_link = "") { |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
182 return 403; |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
183 } |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
184 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
185 if ($secure_link = "0") { |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
186 return 410; |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
187 } |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
188 } |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
189 } |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
190 } |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
191 </example> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
192 </para> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
193 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
194 </directive> |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
195 |
8cb0c634ff97
HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1128
diff
changeset
|
196 |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
197 <directive name="hls_fragment"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
198 <syntax><value>time</value></syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
199 <default>5s</default> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
200 <context>http</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
201 <context>server</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
202 <context>location</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
203 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
204 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
953
diff
changeset
|
205 Defines the default fragment length for playlist URIs requested without the |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
206 “<literal>len</literal>” argument. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
207 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
208 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
209 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
210 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
211 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
212 <directive name="hls_mp4_buffer_size"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
213 <syntax><value>size</value></syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
214 <default>512k</default> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
215 <context>http</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
216 <context>server</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
217 <context>location</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
218 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
219 <para> |
1153
4e20e4f8f49b
Finished truncation of "memory buffers" to just "buffers".
Ruslan Ermilov <ru@nginx.com>
parents:
1147
diff
changeset
|
220 Sets the initial <value>size</value> of the buffer used for |
4e20e4f8f49b
Finished truncation of "memory buffers" to just "buffers".
Ruslan Ermilov <ru@nginx.com>
parents:
1147
diff
changeset
|
221 processing MP4 files. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
222 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
223 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
224 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
225 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
226 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
227 <directive name="hls_mp4_max_buffer_size"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
228 <syntax><value>size</value></syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
229 <default>10m</default> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
230 <context>http</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
231 <context>server</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
232 <context>location</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
233 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
234 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
235 During metadata processing, a larger buffer may become necessary. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
236 Its size cannot exceed the specified <value>size</value>, |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
237 or else nginx will return the server error |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
238 <http-status code="500" text="Internal Server Error"/>, |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
953
diff
changeset
|
239 and log the following message: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
240 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
241 "/some/movie/file.mp4" mp4 moov atom is too large: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
242 12583268, you may want to increase hls_mp4_max_buffer_size |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
243 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
244 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
245 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
246 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
247 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
248 </section> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
249 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
250 </module> |