annotate xml/en/docs/http/ngx_http_mp4_module.xml @ 3014:c0a4a4a55e45

Documented Periodic Session object in njs Reference.
author Yaroslav Zhuravlev <yar@nginx.com>
date Fri, 29 Sep 2023 20:06:59 +0100
parents 17ed19394953
children 9eadb98ec770
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1 <?xml version="1.0"?>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2
580
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 271
diff changeset
3 <!--
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 271
diff changeset
4 Copyright (C) Nginx, Inc.
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 271
diff changeset
5 -->
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 271
diff changeset
6
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8
89
f451dc5c5c82 Module names corrected.
Ruslan Ermilov <ru@nginx.com>
parents: 88
diff changeset
9 <module name="Module ngx_http_mp4_module"
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10 link="/en/docs/http/ngx_http_mp4_module.html"
589
764fbac1b8b4 Added document revision.
Ruslan Ermilov <ru@nginx.com>
parents: 580
diff changeset
11 lang="en"
2797
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
12 rev="9">
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13
110
40eec261c2a6 Added proper support for anonymous sections, notably for the summary.
Ruslan Ermilov <ru@nginx.com>
parents: 102
diff changeset
14 <section id="summary">
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
16 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
17 The <literal>ngx_http_mp4_module</literal> module provides pseudo-streaming
1105
eb3713019359 The module is no longer restricted to acv1/mp4a.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1104
diff changeset
18 server-side support for MP4 files.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
19 Such files typically have the <path>.mp4</path>, <path>.m4v</path>,
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
20 or <path>.m4a</path> filename extensions.
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
23 <para>
2796
bcdb13e1e8c6 Minor updates to ngx_http_mp4_module module intro.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1153
diff changeset
24 Pseudo-streaming works in alliance with a compatible media player.
1104
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
25 The player sends an HTTP request to the server with the start time
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
26 specified in the query string argument (named simply
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 151
diff changeset
27 <literal>start</literal>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
28 and specified in seconds), and the server responds with the stream
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
29 such that its start position corresponds to the requested time,
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
30 for example:
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
31 <example>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
32 http://example.com/elephants_dream.mp4?start=238.88
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
33 </example>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
34 This allows performing a random seeking at any time, or starting playback
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
35 in the middle of the timeline.
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
36 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
37
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
38 <para>
1104
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
39 To support seeking, H.264-based formats store metadata
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
40 in a so-called “moov atom”.
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
41 It is a part of the file that holds the index information for the
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
42 whole file.
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
43 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
44
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
45 <para>
1104
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
46 To start playback, the player first needs to read metadata.
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
47 This is done by sending a special request with the
1096
f34be6b26447 Corrected text formatting for ngx_http_mp4_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1088
diff changeset
48 <literal>start=0</literal> argument.
1104
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
49 A lot of encoding software insert the metadata at
1096
f34be6b26447 Corrected text formatting for ngx_http_mp4_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1088
diff changeset
50 the end of the file.
1104
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
51 This is suboptimal for pseudo-streaming, because the player
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
52 has to download the entire file before starting playback.
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
53 If the metadata are located at the beginning of the file,
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
54 it is enough for nginx to simply start sending back the file contents.
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
55 If the metadata are located at the end of the file,
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
56 nginx must read the entire file and prepare a new stream so that
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
57 the metadata come before the media data.
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
58 This involves some CPU, memory, and disk I/O overhead,
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
59 so it is a good idea to
52
666e85596e3c Added support for <link url="..."> which should eventually replace
Ruslan Ermilov <ru@nginx.com>
parents: 33
diff changeset
60 <link
2796
bcdb13e1e8c6 Minor updates to ngx_http_mp4_module module intro.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1153
diff changeset
61 url="https://github.com/flowplayer/flowplayer/wiki/7.1.1-video-file-correction">
1104
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
62 prepare an original file for pseudo-streaming</link> in advance,
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
63 rather than having nginx do this on every such request.
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
64 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
65
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
66 <para>
1106
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
67 The module also supports the <literal>end</literal> argument of an HTTP request
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
68 (1.5.13) which sets the end point of playback.
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
69 The <literal>end</literal> argument can be specified with the
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
70 <literal>start</literal> argument
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
71 or separately:
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
72 <example>
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
73 http://example.com/elephants_dream.mp4?start=238.88&amp;end=555.55
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
74 </example>
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
75 </para>
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
76
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
77 <para>
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
78 For a matching request with a non-zero
1106
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
79 <literal>start</literal> or <literal>end</literal>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
80 argument, nginx will read the metadata from the file, prepare the
1106
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
81 stream with the requested time range, and send it to the client.
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
82 This has the same overhead as described above.
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
83 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
84
2797
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
85 <para id="keyframe">
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
86 If the <literal>start</literal> argument points to
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
87 a non-key video frame,
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
88 the beginning of such video will be broken.
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
89 To fix this issue, the video
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
90 <link id="mp4_start_key_frame">can</link> be prepended with
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
91 the key frame before <literal>start</literal> point
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
92 and with all intermediate frames between them.
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
93 These frames will be hidden from playback
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
94 using an edit list (1.21.4).
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
95 </para>
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
96
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
97 <para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
98 If a matching request does not include the
1106
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
99 <literal>start</literal> and <literal>end</literal>
5a7f86254a34 Mp4: documented the "end" request argument support.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1105
diff changeset
100 arguments, there is no overhead, and the file is sent simply as a static
1104
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
101 resource.
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
102 Some players also support byte-range requests, and thus do not require
1104
028f6a4d8046 Corrected punctuation, grammar, style, rephrased some sentences.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1103
diff changeset
103 this module.
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
104 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
105
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
106 <para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
107 This module is not built by default, it should be enabled with the
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 151
diff changeset
108 <literal>--with-http_mp4_module</literal>
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
109 configuration parameter.
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
110 <note>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
111 If a third-party mp4 module was previously used, it should be disabled.
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
112 </note>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
113 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
114
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
115 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
116 A similar pseudo-streaming support for FLV files is provided by the
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
117 <link doc="ngx_http_flv_module.xml">ngx_http_flv_module</link> module.
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
118 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
119
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
120 </section>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
121
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
122
53
60796d056dde Renamed section name "Usage example" to "Example Configuration"
Ruslan Ermilov <ru@nginx.com>
parents: 52
diff changeset
123 <section id="example" name="Example Configuration">
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
124
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
125 <para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
126 <example>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
127 location /video/ {
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
128 mp4;
953
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
129 mp4_buffer_size 1m;
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
130 mp4_max_buffer_size 5m;
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
131 mp4_limit_rate on;
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
132 mp4_limit_rate_after 30s;
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
133 }
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
134 </example>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
135 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
136
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
137 </section>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
138
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
139
33
ae5aca1efe2c Using new <module> and <section> format in ngx_http_mp4_module.xml.
Igor Sysoev <igor@sysoev.ru>
parents: 22
diff changeset
140 <section id="directives" name="Directives">
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
141
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
142 <directive name="mp4">
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 89
diff changeset
143 <syntax/>
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
144 <default/>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
145 <context>location</context>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
146
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
147 <para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
148 Turns on module processing in a surrounding location.
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
149 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
150
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
151 </directive>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
152
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
153
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
154 <directive name="mp4_buffer_size">
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 151
diff changeset
155 <syntax><value>size</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 89
diff changeset
156 <default>512K</default>
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
157 <context>http</context>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
158 <context>server</context>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
159 <context>location</context>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
160
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
161 <para>
1153
4e20e4f8f49b Finished truncation of "memory buffers" to just "buffers".
Ruslan Ermilov <ru@nginx.com>
parents: 1128
diff changeset
162 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: 1128
diff changeset
163 processing MP4 files.
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
164 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
165
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
166 </directive>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
167
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
168
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
169 <directive name="mp4_max_buffer_size">
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 151
diff changeset
170 <syntax><value>size</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 89
diff changeset
171 <default>10M</default>
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
172 <context>http</context>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
173 <context>server</context>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
174 <context>location</context>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
175
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
176 <para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
177 During metadata processing, a larger buffer may become necessary.
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 151
diff changeset
178 Its size cannot exceed the specified <value>size</value>,
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
179 or else nginx will return the
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
180 <http-status code="500" text="Internal Server Error"/> server error,
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
181 and log the following message:
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
182 <example>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
183 "/some/movie/file.mp4" mp4 moov atom is too large:
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
184 12583268, you may want to increase mp4_max_buffer_size
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
185 </example>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
186 </para>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
187
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
188 </directive>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
189
953
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
190
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
191 <directive name="mp4_limit_rate">
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
192 <syntax>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
193 <literal>on</literal> |
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
194 <literal>off</literal> |
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
195 <value>factor</value></syntax>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
196 <default>off</default>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
197 <context>http</context>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
198 <context>server</context>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
199 <context>location</context>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
200
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
201 <para>
1103
1fcf8c840dbe Corrected EN text of mp4_limit_rate, mp4_limit_rate_after, translated into RU.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1096
diff changeset
202 Limits the rate of response transmission to a client.
1fcf8c840dbe Corrected EN text of mp4_limit_rate, mp4_limit_rate_after, translated into RU.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1096
diff changeset
203 The rate is limited based on the average bitrate of the
953
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
204 MP4 file served.
956
488a3f738db0 Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 953
diff changeset
205 To calculate the rate, the bitrate is multiplied by the specified
953
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
206 <value>factor</value>.
956
488a3f738db0 Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 953
diff changeset
207 The special value “<literal>on</literal>” corresponds to the factor of 1.1.
1103
1fcf8c840dbe Corrected EN text of mp4_limit_rate, mp4_limit_rate_after, translated into RU.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1096
diff changeset
208 The special value “<literal>off</literal>” disables rate limiting.
1fcf8c840dbe Corrected EN text of mp4_limit_rate, mp4_limit_rate_after, translated into RU.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1096
diff changeset
209 The limit is set per a request, and so if a client simultaneously opens
1fcf8c840dbe Corrected EN text of mp4_limit_rate, mp4_limit_rate_after, translated into RU.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1096
diff changeset
210 two connections, the overall rate will be twice as much
1fcf8c840dbe Corrected EN text of mp4_limit_rate, mp4_limit_rate_after, translated into RU.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1096
diff changeset
211 as the specified limit.
953
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
212 </para>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
213
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
214 <para>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
215 <note>
1128
1594ed379f1f De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents: 1115
diff changeset
216 This directive is available as part of our
1594ed379f1f De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents: 1115
diff changeset
217 <commercial_version>commercial subscription</commercial_version>.
953
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
218 </note>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
219 </para>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
220
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
221 </directive>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
222
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
223
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
224 <directive name="mp4_limit_rate_after">
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
225 <syntax><value>time</value></syntax>
1103
1fcf8c840dbe Corrected EN text of mp4_limit_rate, mp4_limit_rate_after, translated into RU.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1096
diff changeset
226 <default>60s</default>
953
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
227 <context>http</context>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
228 <context>server</context>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
229 <context>location</context>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
230
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
231 <para>
1103
1fcf8c840dbe Corrected EN text of mp4_limit_rate, mp4_limit_rate_after, translated into RU.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1096
diff changeset
232 Sets the initial amount of media data (measured in playback time)
1fcf8c840dbe Corrected EN text of mp4_limit_rate, mp4_limit_rate_after, translated into RU.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1096
diff changeset
233 after which the further transmission of the response to a client
1fcf8c840dbe Corrected EN text of mp4_limit_rate, mp4_limit_rate_after, translated into RU.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1096
diff changeset
234 will be rate limited.
953
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
235 </para>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
236
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
237 <para>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
238 <note>
1128
1594ed379f1f De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents: 1115
diff changeset
239 This directive is available as part of our
1594ed379f1f De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents: 1115
diff changeset
240 <commercial_version>commercial subscription</commercial_version>.
953
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
241 </note>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
242 </para>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
243
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
244 </directive>
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 659
diff changeset
245
2797
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
246
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
247 <directive name="mp4_start_key_frame">
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
248 <syntax><literal>on</literal> | <literal>off</literal></syntax>
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
249 <default>off</default>
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
250 <context>http</context>
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
251 <context>server</context>
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
252 <context>location</context>
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
253 <appeared-in>1.21.4</appeared-in>
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
254
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
255 <para>
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
256 Forces output video to always start with a key video frame.
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
257 If the <literal>start</literal> argument does not point to a key frame,
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
258 initial frames are hidden using an mp4 edit list.
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
259 Edit lists are supported by major players and browsers such as
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
260 Chrome, Safari, QuickTime and ffmpeg,
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
261 partially supported by Firefox.
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
262 </para>
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
263
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
264 </directive>
17ed19394953 Documented the mp4_start_key_frame directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2796
diff changeset
265
22
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
266 </section>
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
267
9d3403f5204d nginx-1.1.3, ngx_http_mp4_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
268 </module>