ffserver: ffserver.html

File ffserver.html, 55.0 KB (added by llogan, 3 months ago)

ffserver documentation from FFmpeg 3.4.5

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6<title>ffserver Documentation</title>
7
8<meta name="description" content="ffserver Documentation">
9<meta name="keywords" content="ffserver Documentation">
10<meta name="resource-type" content="document">
11<meta name="distribution" content="global">
12<meta name="Generator" content="makeinfo">
13<link href="#SEC_Contents" rel="contents" title="Table of Contents">
14<style type="text/css">
15<!--
16a.summary-letter {text-decoration: none}
17blockquote.indentedblock {margin-right: 0em}
18blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
19blockquote.smallquotation {font-size: smaller}
20div.display {margin-left: 3.2em}
21div.example {margin-left: 3.2em}
22div.lisp {margin-left: 3.2em}
23div.smalldisplay {margin-left: 3.2em}
24div.smallexample {margin-left: 3.2em}
25div.smalllisp {margin-left: 3.2em}
26kbd {font-style: oblique}
27pre.display {font-family: inherit}
28pre.format {font-family: inherit}
29pre.menu-comment {font-family: serif}
30pre.menu-preformatted {font-family: serif}
31pre.smalldisplay {font-family: inherit; font-size: smaller}
32pre.smallexample {font-size: smaller}
33pre.smallformat {font-family: inherit; font-size: smaller}
34pre.smalllisp {font-size: smaller}
35span.nolinebreak {white-space: nowrap}
36span.roman {font-family: initial; font-weight: normal}
37span.sansserif {font-family: sans-serif; font-weight: normal}
38ul.no-bullet {list-style: none}
39-->
40</style>
41
42
43</head>
44
45<body lang="en">
46<h1 class="settitle" align="center">ffserver Documentation</h1>
47
48
49<a name="SEC_Top"></a>
50
51<a name="SEC_Contents"></a>
52<h2 class="contents-heading">Table of Contents</h2>
53
54<div class="contents">
55
56<ul class="no-bullet">
57  <li><a name="toc-Synopsis" href="#Synopsis">1 Synopsis</a></li>
58  <li><a name="toc-Description" href="#Description">2 Description</a></li>
59  <li><a name="toc-Detailed-description" href="#Detailed-description">3 Detailed description</a>
60  <ul class="no-bullet">
61    <li><a name="toc-FFM_002c-FFM2-formats" href="#FFM_002c-FFM2-formats">3.1 FFM, FFM2 formats</a></li>
62    <li><a name="toc-Status-stream" href="#Status-stream">3.2 Status stream</a></li>
63    <li><a name="toc-How-do-I-make-it-work_003f" href="#How-do-I-make-it-work_003f">3.3 How do I make it work?</a></li>
64    <li><a name="toc-What-else-can-it-do_003f" href="#What-else-can-it-do_003f">3.4 What else can it do?</a></li>
65    <li><a name="toc-Tips" href="#Tips">3.5 Tips</a></li>
66    <li><a name="toc-Why-does-the-_003fbuffer-_002f-Preroll-stop-working-after-a-time_003f" href="#Why-does-the-_003fbuffer-_002f-Preroll-stop-working-after-a-time_003f">3.6 Why does the ?buffer / Preroll stop working after a time?</a></li>
67    <li><a name="toc-Does-the-_003fdate_003d-stuff-work_002e" href="#Does-the-_003fdate_003d-stuff-work_002e">3.7 Does the <code>?date=</code> stuff work.</a></li>
68  </ul></li>
69  <li><a name="toc-Options" href="#Options">4 Options</a>
70  <ul class="no-bullet">
71    <li><a name="toc-Stream-specifiers-1" href="#Stream-specifiers-1">4.1 Stream specifiers</a></li>
72    <li><a name="toc-Generic-options" href="#Generic-options">4.2 Generic options</a></li>
73    <li><a name="toc-AVOptions" href="#AVOptions">4.3 AVOptions</a></li>
74    <li><a name="toc-Main-options" href="#Main-options">4.4 Main options</a></li>
75  </ul></li>
76  <li><a name="toc-Configuration-file-syntax" href="#Configuration-file-syntax">5 Configuration file syntax</a>
77  <ul class="no-bullet">
78    <li><a name="toc-ACL-syntax" href="#ACL-syntax">5.1 ACL syntax</a></li>
79    <li><a name="toc-Global-options" href="#Global-options">5.2 Global options</a></li>
80    <li><a name="toc-Feed-section" href="#Feed-section">5.3 Feed section</a></li>
81    <li><a name="toc-Stream-section" href="#Stream-section">5.4 Stream section</a>
82    <ul class="no-bullet">
83      <li><a name="toc-Server-status-stream" href="#Server-status-stream">5.4.1 Server status stream</a></li>
84    </ul></li>
85    <li><a name="toc-Redirect-section" href="#Redirect-section">5.5 Redirect section</a></li>
86  </ul></li>
87  <li><a name="toc-Stream-examples" href="#Stream-examples">6 Stream examples</a></li>
88  <li><a name="toc-See-Also" href="#See-Also">7 See Also</a></li>
89  <li><a name="toc-Authors" href="#Authors">8 Authors</a></li>
90</ul>
91</div>
92
93
94<a name="Synopsis"></a>
95<h2 class="chapter">1 Synopsis</h2>
96
97<p>ffserver [<var>options</var>]
98</p>
99<a name="Description"></a>
100<h2 class="chapter">2 Description</h2>
101
102<p><code>ffserver</code> is a streaming server for both audio and video.
103It supports several live feeds, streaming from files and time shifting
104on live feeds. You can seek to positions in the past on each live
105feed, provided you specify a big enough feed storage.
106</p>
107<p><code>ffserver</code> is configured through a configuration file, which
108is read at startup. If not explicitly specified, it will read from
109<samp>/etc/ffserver.conf</samp>.
110</p>
111<p><code>ffserver</code> receives prerecorded files or FFM streams from some
112<code>ffmpeg</code> instance as input, then streams them over
113RTP/RTSP/HTTP.
114</p>
115<p>An <code>ffserver</code> instance will listen on some port as specified
116in the configuration file. You can launch one or more instances of
117<code>ffmpeg</code> and send one or more FFM streams to the port where
118ffserver is expecting to receive them. Alternately, you can make
119<code>ffserver</code> launch such <code>ffmpeg</code> instances at startup.
120</p>
121<p>Input streams are called feeds, and each one is specified by a
122<code>&lt;Feed&gt;</code> section in the configuration file.
123</p>
124<p>For each feed you can have different output streams in various
125formats, each one specified by a <code>&lt;Stream&gt;</code> section in the
126configuration file.
127</p>
128<a name="Detailed-description"></a>
129<h2 class="chapter">3 Detailed description</h2>
130
131<p><code>ffserver</code> works by forwarding streams encoded by
132<code>ffmpeg</code>, or pre-recorded streams which are read from disk.
133</p>
134<p>Precisely, <code>ffserver</code> acts as an HTTP server, accepting POST
135requests from <code>ffmpeg</code> to acquire the stream to publish, and
136serving RTSP clients or HTTP clients GET requests with the stream
137media content.
138</p>
139<p>A feed is an <a href="#FFM">FFM</a> stream created by <code>ffmpeg</code>, and sent to
140a port where <code>ffserver</code> is listening.
141</p>
142<p>Each feed is identified by a unique name, corresponding to the name
143of the resource published on <code>ffserver</code>, and is configured by
144a dedicated <code>Feed</code> section in the configuration file.
145</p>
146<p>The feed publish URL is given by:
147</p><div class="example">
148<pre class="example">http://<var>ffserver_ip_address</var>:<var>http_port</var>/<var>feed_name</var>
149</pre></div>
150
151<p>where <var>ffserver_ip_address</var> is the IP address of the machine where
152<code>ffserver</code> is installed, <var>http_port</var> is the port number of
153the HTTP server (configured through the <samp>HTTPPort</samp> option), and
154<var>feed_name</var> is the name of the corresponding feed defined in the
155configuration file.
156</p>
157<p>Each feed is associated to a file which is stored on disk. This stored
158file is used to send pre-recorded data to a player as fast as
159possible when new content is added in real-time to the stream.
160</p>
161<p>A &quot;live-stream&quot; or &quot;stream&quot; is a resource published by
162<code>ffserver</code>, and made accessible through the HTTP protocol to
163clients.
164</p>
165<p>A stream can be connected to a feed, or to a file. In the first case,
166the published stream is forwarded from the corresponding feed
167generated by a running instance of <code>ffmpeg</code>, in the second
168case the stream is read from a pre-recorded file.
169</p>
170<p>Each stream is identified by a unique name, corresponding to the name
171of the resource served by <code>ffserver</code>, and is configured by
172a dedicated <code>Stream</code> section in the configuration file.
173</p>
174<p>The stream access HTTP URL is given by:
175</p><div class="example">
176<pre class="example">http://<var>ffserver_ip_address</var>:<var>http_port</var>/<var>stream_name</var>[<var>options</var>]
177</pre></div>
178
179<p>The stream access RTSP URL is given by:
180</p><div class="example">
181<pre class="example">http://<var>ffserver_ip_address</var>:<var>rtsp_port</var>/<var>stream_name</var>[<var>options</var>]
182</pre></div>
183
184<p><var>stream_name</var> is the name of the corresponding stream defined in
185the configuration file. <var>options</var> is a list of options specified
186after the URL which affects how the stream is served by
187<code>ffserver</code>. <var>http_port</var> and <var>rtsp_port</var> are the HTTP
188and RTSP ports configured with the options <var>HTTPPort</var> and
189<var>RTSPPort</var> respectively.
190</p>
191<p>In case the stream is associated to a feed, the encoding parameters
192must be configured in the stream configuration. They are sent to
193<code>ffmpeg</code> when setting up the encoding. This allows
194<code>ffserver</code> to define the encoding parameters used by
195the <code>ffmpeg</code> encoders.
196</p>
197<p>The <code>ffmpeg</code> <samp>override_ffserver</samp> commandline option
198allows one to override the encoding parameters set by the server.
199</p>
200<p>Multiple streams can be connected to the same feed.
201</p>
202<p>For example, you can have a situation described by the following
203graph:
204</p>
205<pre class="verbatim">               _________       __________
206              |         |     |          |
207ffmpeg 1 -----| feed 1  |-----| stream 1 |
208    \         |_________|\    |__________|
209     \                    \
210      \                    \   __________
211       \                    \ |          |
212        \                    \| stream 2 |
213         \                    |__________|
214          \
215           \   _________       __________
216            \ |         |     |          |
217             \| feed 2  |-----| stream 3 |
218              |_________|     |__________|
219
220               _________       __________
221              |         |     |          |
222ffmpeg 2 -----| feed 3  |-----| stream 4 |
223              |_________|     |__________|
224
225               _________       __________
226              |         |     |          |
227              | file 1  |-----| stream 5 |
228              |_________|     |__________|
229
230</pre>
231<a name="FFM"></a><a name="FFM_002c-FFM2-formats"></a>
232<h3 class="section">3.1 FFM, FFM2 formats</h3>
233
234<p>FFM and FFM2 are formats used by ffserver. They allow storing a wide variety of
235video and audio streams and encoding options, and can store a moving time segment
236of an infinite movie or a whole movie.
237</p>
238<p>FFM is version specific, and there is limited compatibility of FFM files
239generated by one version of ffmpeg/ffserver and another version of
240ffmpeg/ffserver. It may work but it is not guaranteed to work.
241</p>
242<p>FFM2 is extensible while maintaining compatibility and should work between
243differing versions of tools. FFM2 is the default.
244</p>
245<a name="Status-stream"></a>
246<h3 class="section">3.2 Status stream</h3>
247
248<p><code>ffserver</code> supports an HTTP interface which exposes the
249current status of the server.
250</p>
251<p>Simply point your browser to the address of the special status stream
252specified in the configuration file.
253</p>
254<p>For example if you have:
255</p><div class="example">
256<pre class="example">&lt;Stream status.html&gt;
257Format status
258
259# Only allow local people to get the status
260ACL allow localhost
261ACL allow 192.168.0.0 192.168.255.255
262&lt;/Stream&gt;
263</pre></div>
264
265<p>then the server will post a page with the status information when
266the special stream <samp>status.html</samp> is requested.
267</p>
268<a name="How-do-I-make-it-work_003f"></a>
269<h3 class="section">3.3 How do I make it work?</h3>
270
271<p>As a simple test, just run the following two command lines where INPUTFILE
272is some file which you can decode with ffmpeg:
273</p>
274<div class="example">
275<pre class="example">ffserver -f doc/ffserver.conf &amp;
276ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm
277</pre></div>
278
279<p>At this point you should be able to go to your Windows machine and fire up
280Windows Media Player (WMP). Go to Open URL and enter
281</p>
282<div class="example">
283<pre class="example">    http://&lt;linuxbox&gt;:8090/test.asf
284</pre></div>
285
286<p>You should (after a short delay) see video and hear audio.
287</p>
288<p>WARNING: trying to stream test1.mpg doesn&rsquo;t work with WMP as it tries to
289transfer the entire file before starting to play.
290The same is true of AVI files.
291</p>
292<p>You should edit the <samp>ffserver.conf</samp> file to suit your needs (in
293terms of frame rates etc). Then install <code>ffserver</code> and
294<code>ffmpeg</code>, write a script to start them up, and off you go.
295</p>
296<a name="What-else-can-it-do_003f"></a>
297<h3 class="section">3.4 What else can it do?</h3>
298
299<p>You can replay video from .ffm files that was recorded earlier.
300However, there are a number of caveats, including the fact that the
301ffserver parameters must match the original parameters used to record the
302file. If they do not, then ffserver deletes the file before recording into it.
303(Now that I write this, it seems broken).
304</p>
305<p>You can fiddle with many of the codec choices and encoding parameters, and
306there are a bunch more parameters that you cannot control. Post a message
307to the mailing list if there are some &rsquo;must have&rsquo; parameters. Look in
308ffserver.conf for a list of the currently available controls.
309</p>
310<p>It will automatically generate the ASX or RAM files that are often used
311in browsers. These files are actually redirections to the underlying ASF
312or RM file. The reason for this is that the browser often fetches the
313entire file before starting up the external viewer. The redirection files
314are very small and can be transferred quickly. [The stream itself is
315often &rsquo;infinite&rsquo; and thus the browser tries to download it and never
316finishes.]
317</p>
318<a name="Tips"></a>
319<h3 class="section">3.5 Tips</h3>
320
321<p>* When you connect to a live stream, most players (WMP, RA, etc) want to
322buffer a certain number of seconds of material so that they can display the
323signal continuously. However, ffserver (by default) starts sending data
324in realtime. This means that there is a pause of a few seconds while the
325buffering is being done by the player. The good news is that this can be
326cured by adding a &rsquo;?buffer=5&rsquo; to the end of the URL. This means that the
327stream should start 5 seconds in the past &ndash; and so the first 5 seconds
328of the stream are sent as fast as the network will allow. It will then
329slow down to real time. This noticeably improves the startup experience.
330</p>
331<p>You can also add a &rsquo;Preroll 15&rsquo; statement into the ffserver.conf that will
332add the 15 second prebuffering on all requests that do not otherwise
333specify a time. In addition, ffserver will skip frames until a key_frame
334is found. This further reduces the startup delay by not transferring data
335that will be discarded.
336</p>
337<a name="Why-does-the-_003fbuffer-_002f-Preroll-stop-working-after-a-time_003f"></a>
338<h3 class="section">3.6 Why does the ?buffer / Preroll stop working after a time?</h3>
339
340<p>It turns out that (on my machine at least) the number of frames successfully
341grabbed is marginally less than the number that ought to be grabbed. This
342means that the timestamp in the encoded data stream gets behind realtime.
343This means that if you say &rsquo;Preroll 10&rsquo;, then when the stream gets 10
344or more seconds behind, there is no Preroll left.
345</p>
346<p>Fixing this requires a change in the internals of how timestamps are
347handled.
348</p>
349<a name="Does-the-_003fdate_003d-stuff-work_002e"></a>
350<h3 class="section">3.7 Does the <code>?date=</code> stuff work.</h3>
351
352<p>Yes (subject to the limitation outlined above). Also note that whenever you
353start ffserver, it deletes the ffm file (if any parameters have changed),
354thus wiping out what you had recorded before.
355</p>
356<p>The format of the <code>?date=xxxxxx</code> is fairly flexible. You should use one
357of the following formats (the &rsquo;T&rsquo; is literal):
358</p>
359<div class="example">
360<pre class="example">* YYYY-MM-DDTHH:MM:SS     (localtime)
361* YYYY-MM-DDTHH:MM:SSZ    (UTC)
362</pre></div>
363
364<p>You can omit the YYYY-MM-DD, and then it refers to the current day. However
365note that &lsquo;<samp>?date=16:00:00</samp>&rsquo; refers to 16:00 on the current day &ndash; this
366may be in the future and so is unlikely to be useful.
367</p>
368<p>You use this by adding the ?date= to the end of the URL for the stream.
369For example:   &lsquo;<samp>http://localhost:8080/test.asf?date=2002-07-26T23:05:00</samp>&rsquo;.
370</p>
371<a name="Options"></a>
372<h2 class="chapter">4 Options</h2>
373
374<p>All the numerical options, if not specified otherwise, accept a string
375representing a number as input, which may be followed by one of the SI
376unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
377</p>
378<p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
379interpreted as a unit prefix for binary multiples, which are based on
380powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
381prefix multiplies the value by 8. This allows using, for example:
382&rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
383</p>
384<p>Options which do not take arguments are boolean options, and set the
385corresponding value to true. They can be set to false by prefixing
386the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
387will set the boolean option with name &quot;foo&quot; to false.
388</p>
389<a name="Stream-specifiers"></a><a name="Stream-specifiers-1"></a>
390<h3 class="section">4.1 Stream specifiers</h3>
391<p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
392are used to precisely specify which stream(s) a given option belongs to.
393</p>
394<p>A stream specifier is a string generally appended to the option name and
395separated from it by a colon. E.g. <code>-codec:a:1 ac3</code> contains the
396<code>a:1</code> stream specifier, which matches the second audio stream. Therefore, it
397would select the ac3 codec for the second audio stream.
398</p>
399<p>A stream specifier can match several streams, so that the option is applied to all
400of them. E.g. the stream specifier in <code>-b:a 128k</code> matches all audio
401streams.
402</p>
403<p>An empty stream specifier matches all streams. For example, <code>-codec copy</code>
404or <code>-codec: copy</code> would copy all the streams without reencoding.
405</p>
406<p>Possible forms of stream specifiers are:
407</p><dl compact="compact">
408<dt><samp><var>stream_index</var></samp></dt>
409<dd><p>Matches the stream with this index. E.g. <code>-threads:1 4</code> would set the
410thread count for the second stream to 4.
411</p></dd>
412<dt><samp><var>stream_type</var>[:<var>stream_index</var>]</samp></dt>
413<dd><p><var>stream_type</var> is one of following: &rsquo;v&rsquo; or &rsquo;V&rsquo; for video, &rsquo;a&rsquo; for audio, &rsquo;s&rsquo;
414for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. &rsquo;v&rsquo; matches all video
415streams, &rsquo;V&rsquo; only matches video streams which are not attached pictures, video
416thumbnails or cover arts.  If <var>stream_index</var> is given, then it matches
417stream number <var>stream_index</var> of this type. Otherwise, it matches all
418streams of this type.
419</p></dd>
420<dt><samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp></dt>
421<dd><p>If <var>stream_index</var> is given, then it matches the stream with number <var>stream_index</var>
422in the program with the id <var>program_id</var>. Otherwise, it matches all streams in the
423program.
424</p></dd>
425<dt><samp>#<var>stream_id</var> or i:<var>stream_id</var></samp></dt>
426<dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
427</p></dd>
428<dt><samp>m:<var>key</var>[:<var>value</var>]</samp></dt>
429<dd><p>Matches streams with the metadata tag <var>key</var> having the specified value. If
430<var>value</var> is not given, matches streams that contain the given tag with any
431value.
432</p></dd>
433<dt><samp>u</samp></dt>
434<dd><p>Matches streams with usable configuration, the codec must be defined and the
435essential information such as video dimension or audio sample rate must be present.
436</p>
437<p>Note that in <code>ffmpeg</code>, matching by metadata will only work properly for
438input files.
439</p></dd>
440</dl>
441
442<a name="Generic-options"></a>
443<h3 class="section">4.2 Generic options</h3>
444
445<p>These options are shared amongst the ff* tools.
446</p>
447<dl compact="compact">
448<dt><samp>-L</samp></dt>
449<dd><p>Show license.
450</p>
451</dd>
452<dt><samp>-h, -?, -help, --help [<var>arg</var>]</samp></dt>
453<dd><p>Show help. An optional parameter may be specified to print help about a specific
454item. If no argument is specified, only basic (non advanced) tool
455options are shown.
456</p>
457<p>Possible values of <var>arg</var> are:
458</p><dl compact="compact">
459<dt><samp>long</samp></dt>
460<dd><p>Print advanced tool options in addition to the basic tool options.
461</p>
462</dd>
463<dt><samp>full</samp></dt>
464<dd><p>Print complete list of options, including shared and private options
465for encoders, decoders, demuxers, muxers, filters, etc.
466</p>
467</dd>
468<dt><samp>decoder=<var>decoder_name</var></samp></dt>
469<dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
470<samp>-decoders</samp> option to get a list of all decoders.
471</p>
472</dd>
473<dt><samp>encoder=<var>encoder_name</var></samp></dt>
474<dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
475<samp>-encoders</samp> option to get a list of all encoders.
476</p>
477</dd>
478<dt><samp>demuxer=<var>demuxer_name</var></samp></dt>
479<dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
480<samp>-formats</samp> option to get a list of all demuxers and muxers.
481</p>
482</dd>
483<dt><samp>muxer=<var>muxer_name</var></samp></dt>
484<dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
485<samp>-formats</samp> option to get a list of all muxers and demuxers.
486</p>
487</dd>
488<dt><samp>filter=<var>filter_name</var></samp></dt>
489<dd><p>Print detailed information about the filter name <var>filter_name</var>. Use the
490<samp>-filters</samp> option to get a list of all filters.
491</p></dd>
492</dl>
493
494</dd>
495<dt><samp>-version</samp></dt>
496<dd><p>Show version.
497</p>
498</dd>
499<dt><samp>-formats</samp></dt>
500<dd><p>Show available formats (including devices).
501</p>
502</dd>
503<dt><samp>-demuxers</samp></dt>
504<dd><p>Show available demuxers.
505</p>
506</dd>
507<dt><samp>-muxers</samp></dt>
508<dd><p>Show available muxers.
509</p>
510</dd>
511<dt><samp>-devices</samp></dt>
512<dd><p>Show available devices.
513</p>
514</dd>
515<dt><samp>-codecs</samp></dt>
516<dd><p>Show all codecs known to libavcodec.
517</p>
518<p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
519for what is more correctly called a media bitstream format.
520</p>
521</dd>
522<dt><samp>-decoders</samp></dt>
523<dd><p>Show available decoders.
524</p>
525</dd>
526<dt><samp>-encoders</samp></dt>
527<dd><p>Show all available encoders.
528</p>
529</dd>
530<dt><samp>-bsfs</samp></dt>
531<dd><p>Show available bitstream filters.
532</p>
533</dd>
534<dt><samp>-protocols</samp></dt>
535<dd><p>Show available protocols.
536</p>
537</dd>
538<dt><samp>-filters</samp></dt>
539<dd><p>Show available libavfilter filters.
540</p>
541</dd>
542<dt><samp>-pix_fmts</samp></dt>
543<dd><p>Show available pixel formats.
544</p>
545</dd>
546<dt><samp>-sample_fmts</samp></dt>
547<dd><p>Show available sample formats.
548</p>
549</dd>
550<dt><samp>-layouts</samp></dt>
551<dd><p>Show channel names and standard channel layouts.
552</p>
553</dd>
554<dt><samp>-colors</samp></dt>
555<dd><p>Show recognized color names.
556</p>
557</dd>
558<dt><samp>-sources <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp></dt>
559<dd><p>Show autodetected sources of the input device.
560Some devices may provide system-dependent source names that cannot be autodetected.
561The returned list cannot be assumed to be always complete.
562</p><div class="example">
563<pre class="example">ffmpeg -sources pulse,server=192.168.0.4
564</pre></div>
565
566</dd>
567<dt><samp>-sinks <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp></dt>
568<dd><p>Show autodetected sinks of the output device.
569Some devices may provide system-dependent sink names that cannot be autodetected.
570The returned list cannot be assumed to be always complete.
571</p><div class="example">
572<pre class="example">ffmpeg -sinks pulse,server=192.168.0.4
573</pre></div>
574
575</dd>
576<dt><samp>-loglevel [repeat+]<var>loglevel</var> | -v [repeat+]<var>loglevel</var></samp></dt>
577<dd><p>Set the logging level used by the library.
578Adding &quot;repeat+&quot; indicates that repeated log output should not be compressed
579to the first line and the &quot;Last message repeated n times&quot; line will be
580omitted. &quot;repeat&quot; can also be used alone.
581If &quot;repeat&quot; is used alone, and with no prior loglevel set, the default
582loglevel will be used. If multiple loglevel parameters are given, using
583&rsquo;repeat&rsquo; will not change the loglevel.
584<var>loglevel</var> is a string or a number containing one of the following values:
585</p><dl compact="compact">
586<dt>&lsquo;<samp>quiet, -8</samp>&rsquo;</dt>
587<dd><p>Show nothing at all; be silent.
588</p></dd>
589<dt>&lsquo;<samp>panic, 0</samp>&rsquo;</dt>
590<dd><p>Only show fatal errors which could lead the process to crash, such as
591an assertion failure. This is not currently used for anything.
592</p></dd>
593<dt>&lsquo;<samp>fatal, 8</samp>&rsquo;</dt>
594<dd><p>Only show fatal errors. These are errors after which the process absolutely
595cannot continue.
596</p></dd>
597<dt>&lsquo;<samp>error, 16</samp>&rsquo;</dt>
598<dd><p>Show all errors, including ones which can be recovered from.
599</p></dd>
600<dt>&lsquo;<samp>warning, 24</samp>&rsquo;</dt>
601<dd><p>Show all warnings and errors. Any message related to possibly
602incorrect or unexpected events will be shown.
603</p></dd>
604<dt>&lsquo;<samp>info, 32</samp>&rsquo;</dt>
605<dd><p>Show informative messages during processing. This is in addition to
606warnings and errors. This is the default value.
607</p></dd>
608<dt>&lsquo;<samp>verbose, 40</samp>&rsquo;</dt>
609<dd><p>Same as <code>info</code>, except more verbose.
610</p></dd>
611<dt>&lsquo;<samp>debug, 48</samp>&rsquo;</dt>
612<dd><p>Show everything, including debugging information.
613</p></dd>
614<dt>&lsquo;<samp>trace, 56</samp>&rsquo;</dt>
615</dl>
616
617<p>By default the program logs to stderr. If coloring is supported by the
618terminal, colors are used to mark errors and warnings. Log coloring
619can be disabled setting the environment variable
620<code>AV_LOG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
621the environment variable <code>AV_LOG_FORCE_COLOR</code>.
622The use of the environment variable <code>NO_COLOR</code> is deprecated and
623will be dropped in a future FFmpeg version.
624</p>
625</dd>
626<dt><samp>-report</samp></dt>
627<dd><p>Dump full command line and console output to a file named
628<code><var>program</var>-<var>YYYYMMDD</var>-<var>HHMMSS</var>.log</code> in the current
629directory.
630This file can be useful for bug reports.
631It also implies <code>-loglevel verbose</code>.
632</p>
633<p>Setting the environment variable <code>FFREPORT</code> to any value has the
634same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
635options will affect the report; option values must be escaped if they
636contain special characters or the options delimiter &rsquo;:&rsquo; (see the
637&ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual).
638</p>
639<p>The following options are recognized:
640</p><dl compact="compact">
641<dt><samp>file</samp></dt>
642<dd><p>set the file name to use for the report; <code>%p</code> is expanded to the name
643of the program, <code>%t</code> is expanded to a timestamp, <code>%%</code> is expanded
644to a plain <code>%</code>
645</p></dd>
646<dt><samp>level</samp></dt>
647<dd><p>set the log verbosity level using a numerical value (see <code>-loglevel</code>).
648</p></dd>
649</dl>
650
651<p>For example, to output a report to a file named <samp>ffreport.log</samp>
652using a log level of <code>32</code> (alias for log level <code>info</code>):
653</p>
654<div class="example">
655<pre class="example">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
656</pre></div>
657
658<p>Errors in parsing the environment variable are not fatal, and will not
659appear in the report.
660</p>
661</dd>
662<dt><samp>-hide_banner</samp></dt>
663<dd><p>Suppress printing banner.
664</p>
665<p>All FFmpeg tools will normally show a copyright notice, build options
666and library versions. This option can be used to suppress printing
667this information.
668</p>
669</dd>
670<dt><samp>-cpuflags flags (<em>global</em>)</samp></dt>
671<dd><p>Allows setting and clearing cpu flags. This option is intended
672for testing. Do not use it unless you know what you&rsquo;re doing.
673</p><div class="example">
674<pre class="example">ffmpeg -cpuflags -sse+mmx ...
675ffmpeg -cpuflags mmx ...
676ffmpeg -cpuflags 0 ...
677</pre></div>
678<p>Possible flags for this option are:
679</p><dl compact="compact">
680<dt>&lsquo;<samp>x86</samp>&rsquo;</dt>
681<dd><dl compact="compact">
682<dt>&lsquo;<samp>mmx</samp>&rsquo;</dt>
683<dt>&lsquo;<samp>mmxext</samp>&rsquo;</dt>
684<dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
685<dt>&lsquo;<samp>sse2</samp>&rsquo;</dt>
686<dt>&lsquo;<samp>sse2slow</samp>&rsquo;</dt>
687<dt>&lsquo;<samp>sse3</samp>&rsquo;</dt>
688<dt>&lsquo;<samp>sse3slow</samp>&rsquo;</dt>
689<dt>&lsquo;<samp>ssse3</samp>&rsquo;</dt>
690<dt>&lsquo;<samp>atom</samp>&rsquo;</dt>
691<dt>&lsquo;<samp>sse4.1</samp>&rsquo;</dt>
692<dt>&lsquo;<samp>sse4.2</samp>&rsquo;</dt>
693<dt>&lsquo;<samp>avx</samp>&rsquo;</dt>
694<dt>&lsquo;<samp>avx2</samp>&rsquo;</dt>
695<dt>&lsquo;<samp>xop</samp>&rsquo;</dt>
696<dt>&lsquo;<samp>fma3</samp>&rsquo;</dt>
697<dt>&lsquo;<samp>fma4</samp>&rsquo;</dt>
698<dt>&lsquo;<samp>3dnow</samp>&rsquo;</dt>
699<dt>&lsquo;<samp>3dnowext</samp>&rsquo;</dt>
700<dt>&lsquo;<samp>bmi1</samp>&rsquo;</dt>
701<dt>&lsquo;<samp>bmi2</samp>&rsquo;</dt>
702<dt>&lsquo;<samp>cmov</samp>&rsquo;</dt>
703</dl>
704</dd>
705<dt>&lsquo;<samp>ARM</samp>&rsquo;</dt>
706<dd><dl compact="compact">
707<dt>&lsquo;<samp>armv5te</samp>&rsquo;</dt>
708<dt>&lsquo;<samp>armv6</samp>&rsquo;</dt>
709<dt>&lsquo;<samp>armv6t2</samp>&rsquo;</dt>
710<dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
711<dt>&lsquo;<samp>vfpv3</samp>&rsquo;</dt>
712<dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
713<dt>&lsquo;<samp>setend</samp>&rsquo;</dt>
714</dl>
715</dd>
716<dt>&lsquo;<samp>AArch64</samp>&rsquo;</dt>
717<dd><dl compact="compact">
718<dt>&lsquo;<samp>armv8</samp>&rsquo;</dt>
719<dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
720<dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
721</dl>
722</dd>
723<dt>&lsquo;<samp>PowerPC</samp>&rsquo;</dt>
724<dd><dl compact="compact">
725<dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
726</dl>
727</dd>
728<dt>&lsquo;<samp>Specific Processors</samp>&rsquo;</dt>
729<dd><dl compact="compact">
730<dt>&lsquo;<samp>pentium2</samp>&rsquo;</dt>
731<dt>&lsquo;<samp>pentium3</samp>&rsquo;</dt>
732<dt>&lsquo;<samp>pentium4</samp>&rsquo;</dt>
733<dt>&lsquo;<samp>k6</samp>&rsquo;</dt>
734<dt>&lsquo;<samp>k62</samp>&rsquo;</dt>
735<dt>&lsquo;<samp>athlon</samp>&rsquo;</dt>
736<dt>&lsquo;<samp>athlonxp</samp>&rsquo;</dt>
737<dt>&lsquo;<samp>k8</samp>&rsquo;</dt>
738</dl>
739</dd>
740</dl>
741
742</dd>
743<dt><samp>-opencl_bench</samp></dt>
744<dd><p>This option is used to benchmark all available OpenCL devices and print the
745results. This option is only available when FFmpeg has been compiled with
746<code>--enable-opencl</code>.
747</p>
748<p>When FFmpeg is configured with <code>--enable-opencl</code>, the options for the
749global OpenCL context are set via <samp>-opencl_options</samp>. See the
750&quot;OpenCL Options&quot; section in the ffmpeg-utils manual for the complete list of
751supported options. Amongst others, these options include the ability to select
752a specific platform and device to run the OpenCL code on. By default, FFmpeg
753will run on the first device of the first platform. While the options for the
754global OpenCL context provide flexibility to the user in selecting the OpenCL
755device of their choice, most users would probably want to select the fastest
756OpenCL device for their system.
757</p>
758<p>This option assists the selection of the most efficient configuration by
759identifying the appropriate device for the user&rsquo;s system. The built-in
760benchmark is run on all the OpenCL devices and the performance is measured for
761each device. The devices in the results list are sorted based on their
762performance with the fastest device listed first. The user can subsequently
763invoke <code>ffmpeg</code> using the device deemed most appropriate via
764<samp>-opencl_options</samp> to obtain the best performance for the OpenCL
765accelerated code.
766</p>
767<p>Typical usage to use the fastest OpenCL device involve the following steps.
768</p>
769<p>Run the command:
770</p><div class="example">
771<pre class="example">ffmpeg -opencl_bench
772</pre></div>
773<p>Note down the platform ID (<var>pidx</var>) and device ID (<var>didx</var>) of the first
774i.e. fastest device in the list.
775Select the platform and device using the command:
776</p><div class="example">
777<pre class="example">ffmpeg -opencl_options platform_idx=<var>pidx</var>:device_idx=<var>didx</var> ...
778</pre></div>
779
780</dd>
781<dt><samp>-opencl_options options (<em>global</em>)</samp></dt>
782<dd><p>Set OpenCL environment options. This option is only available when
783FFmpeg has been compiled with <code>--enable-opencl</code>.
784</p>
785<p><var>options</var> must be a list of <var>key</var>=<var>value</var> option pairs
786separated by &rsquo;:&rsquo;. See the &ldquo;OpenCL Options&rdquo; section in the
787ffmpeg-utils manual for the list of supported options.
788</p></dd>
789</dl>
790
791<a name="AVOptions"></a>
792<h3 class="section">4.3 AVOptions</h3>
793
794<p>These options are provided directly by the libavformat, libavdevice and
795libavcodec libraries. To see the list of available AVOptions, use the
796<samp>-help</samp> option. They are separated into two categories:
797</p><dl compact="compact">
798<dt><samp>generic</samp></dt>
799<dd><p>These options can be set for any container, codec or device. Generic options
800are listed under AVFormatContext options for containers/devices and under
801AVCodecContext options for codecs.
802</p></dd>
803<dt><samp>private</samp></dt>
804<dd><p>These options are specific to the given container, device or codec. Private
805options are listed under their corresponding containers/devices/codecs.
806</p></dd>
807</dl>
808
809<p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
810an MP3 file, use the <samp>id3v2_version</samp> private option of the MP3
811muxer:
812</p><div class="example">
813<pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
814</pre></div>
815
816<p>All codec AVOptions are per-stream, and thus a stream specifier
817should be attached to them.
818</p>
819<p>Note: the <samp>-nooption</samp> syntax cannot be used for boolean
820AVOptions, use <samp>-option 0</samp>/<samp>-option 1</samp>.
821</p>
822<p>Note: the old undocumented way of specifying per-stream AVOptions by
823prepending v/a/s to the options name is now obsolete and will be
824removed soon.
825</p>
826<a name="Main-options"></a>
827<h3 class="section">4.4 Main options</h3>
828
829<dl compact="compact">
830<dt><samp>-f <var>configfile</var></samp></dt>
831<dd><p>Read configuration file <samp>configfile</samp>. If not specified it will
832read by default from <samp>/etc/ffserver.conf</samp>.
833</p>
834</dd>
835<dt><samp>-n</samp></dt>
836<dd><p>Enable no-launch mode. This option disables all the <code>Launch</code>
837directives within the various <code>&lt;Feed&gt;</code> sections. Since
838<code>ffserver</code> will not launch any <code>ffmpeg</code> instances, you
839will have to launch them manually.
840</p>
841</dd>
842<dt><samp>-d</samp></dt>
843<dd><p>Enable debug mode. This option increases log verbosity, and directs
844log messages to stdout. When specified, the <samp>CustomLog</samp> option
845is ignored.
846</p></dd>
847</dl>
848
849<a name="Configuration-file-syntax"></a>
850<h2 class="chapter">5 Configuration file syntax</h2>
851
852<p><code>ffserver</code> reads a configuration file containing global
853options and settings for each stream and feed.
854</p>
855<p>The configuration file consists of global options and dedicated
856sections, which must be introduced by &quot;&lt;<var>SECTION_NAME</var>
857<var>ARGS</var>&gt;&quot; on a separate line and must be terminated by a line in
858the form &quot;&lt;/<var>SECTION_NAME</var>&gt;&quot;. <var>ARGS</var> is optional.
859</p>
860<p>Currently the following sections are recognized: &lsquo;<samp>Feed</samp>&rsquo;,
861&lsquo;<samp>Stream</samp>&rsquo;, &lsquo;<samp>Redirect</samp>&rsquo;.
862</p>
863<p>A line starting with <code>#</code> is ignored and treated as a comment.
864</p>
865<p>Name of options and sections are case-insensitive.
866</p>
867<a name="ACL-syntax"></a>
868<h3 class="section">5.1 ACL syntax</h3>
869<p>An ACL (Access Control List) specifies the address which are allowed
870to access a given stream, or to write a given feed.
871</p>
872<p>It accepts the following forms
873</p><ul>
874<li> Allow/deny access to <var>address</var>.
875<div class="example">
876<pre class="example">ACL ALLOW &lt;address&gt;
877ACL DENY &lt;address&gt;
878</pre></div>
879
880</li><li> Allow/deny access to ranges of addresses from <var>first_address</var> to
881<var>last_address</var>.
882<div class="example">
883<pre class="example">ACL ALLOW &lt;first_address&gt; &lt;last_address&gt;
884ACL DENY &lt;first_address&gt; &lt;last_address&gt;
885</pre></div>
886</li></ul>
887
888<p>You can repeat the ACL allow/deny as often as you like. It is on a per
889stream basis. The first match defines the action. If there are no matches,
890then the default is the inverse of the last ACL statement.
891</p>
892<p>Thus &rsquo;ACL allow localhost&rsquo; only allows access from localhost.
893&rsquo;ACL deny 1.0.0.0 1.255.255.255&rsquo; would deny the whole of network 1 and
894allow everybody else.
895</p>
896<a name="Global-options"></a>
897<h3 class="section">5.2 Global options</h3>
898<dl compact="compact">
899<dt><samp>HTTPPort <var>port_number</var></samp></dt>
900<dt><samp>Port <var>port_number</var></samp></dt>
901<dt><samp>RTSPPort <var>port_number</var></samp></dt>
902<dd>
903<p><var>HTTPPort</var> sets the HTTP server listening TCP port number,
904<var>RTSPPort</var> sets the RTSP server listening TCP port number.
905</p>
906<p><var>Port</var> is the equivalent of <var>HTTPPort</var> and is deprecated.
907</p>
908<p>You must select a different port from your standard HTTP web server if
909it is running on the same computer.
910</p>
911<p>If not specified, no corresponding server will be created.
912</p>
913</dd>
914<dt><samp>HTTPBindAddress <var>ip_address</var></samp></dt>
915<dt><samp>BindAddress <var>ip_address</var></samp></dt>
916<dt><samp>RTSPBindAddress <var>ip_address</var></samp></dt>
917<dd><p>Set address on which the HTTP/RTSP server is bound. Only useful if you
918have several network interfaces.
919</p>
920<p><var>BindAddress</var> is the equivalent of <var>HTTPBindAddress</var> and is
921deprecated.
922</p>
923</dd>
924<dt><samp>MaxHTTPConnections <var>n</var></samp></dt>
925<dd><p>Set number of simultaneous HTTP connections that can be handled. It
926has to be defined <em>before</em> the <samp>MaxClients</samp> parameter,
927since it defines the <samp>MaxClients</samp> maximum limit.
928</p>
929<p>Default value is 2000.
930</p>
931</dd>
932<dt><samp>MaxClients <var>n</var></samp></dt>
933<dd><p>Set number of simultaneous requests that can be handled. Since
934<code>ffserver</code> is very fast, it is more likely that you will want
935to leave this high and use <samp>MaxBandwidth</samp>.
936</p>
937<p>Default value is 5.
938</p>
939</dd>
940<dt><samp>MaxBandwidth <var>kbps</var></samp></dt>
941<dd><p>Set the maximum amount of kbit/sec that you are prepared to consume
942when streaming to clients.
943</p>
944<p>Default value is 1000.
945</p>
946</dd>
947<dt><samp>CustomLog <var>filename</var></samp></dt>
948<dd><p>Set access log file (uses standard Apache log file format). &rsquo;-&rsquo; is the
949standard output.
950</p>
951<p>If not specified <code>ffserver</code> will produce no log.
952</p>
953<p>In case the commandline option <samp>-d</samp> is specified this option is
954ignored, and the log is written to standard output.
955</p>
956</dd>
957<dt><samp>NoDaemon</samp></dt>
958<dd><p>Set no-daemon mode. This option is currently ignored since now
959<code>ffserver</code> will always work in no-daemon mode, and is
960deprecated.
961</p>
962</dd>
963<dt><samp>UseDefaults</samp></dt>
964<dt><samp>NoDefaults</samp></dt>
965<dd><p>Control whether default codec options are used for the all streams or not.
966Each stream may overwrite this setting for its own. Default is <var>UseDefaults</var>.
967The last occurrence overrides the previous if multiple definitions exist.
968</p></dd>
969</dl>
970
971<a name="Feed-section"></a>
972<h3 class="section">5.3 Feed section</h3>
973
974<p>A Feed section defines a feed provided to <code>ffserver</code>.
975</p>
976<p>Each live feed contains one video and/or audio sequence coming from an
977<code>ffmpeg</code> encoder or another <code>ffserver</code>. This sequence
978may be encoded simultaneously with several codecs at several
979resolutions.
980</p>
981<p>A feed instance specification is introduced by a line in the form:
982</p><div class="example">
983<pre class="example">&lt;Feed FEED_FILENAME&gt;
984</pre></div>
985
986<p>where <var>FEED_FILENAME</var> specifies the unique name of the FFM stream.
987</p>
988<p>The following options are recognized within a Feed section.
989</p>
990<dl compact="compact">
991<dt><samp>File <var>filename</var></samp></dt>
992<dt><samp>ReadOnlyFile <var>filename</var></samp></dt>
993<dd><p>Set the path where the feed file is stored on disk.
994</p>
995<p>If not specified, the <samp>/tmp/FEED.ffm</samp> is assumed, where
996<var>FEED</var> is the feed name.
997</p>
998<p>If <samp>ReadOnlyFile</samp> is used the file is marked as read-only and
999it will not be deleted or updated.
1000</p>
1001</dd>
1002<dt><samp>Truncate</samp></dt>
1003<dd><p>Truncate the feed file, rather than appending to it. By default
1004<code>ffserver</code> will append data to the file, until the maximum
1005file size value is reached (see <samp>FileMaxSize</samp> option).
1006</p>
1007</dd>
1008<dt><samp>FileMaxSize <var>size</var></samp></dt>
1009<dd><p>Set maximum size of the feed file in bytes. 0 means unlimited. The
1010postfixes <code>K</code> (2^10), <code>M</code> (2^20), and <code>G</code> (2^30) are
1011recognized.
1012</p>
1013<p>Default value is 5M.
1014</p>
1015</dd>
1016<dt><samp>Launch <var>args</var></samp></dt>
1017<dd><p>Launch an <code>ffmpeg</code> command when creating <code>ffserver</code>.
1018</p>
1019<p><var>args</var> must be a sequence of arguments to be provided to an
1020<code>ffmpeg</code> instance. The first provided argument is ignored, and
1021it is replaced by a path with the same dirname of the <code>ffserver</code>
1022instance, followed by the remaining argument and terminated with a
1023path corresponding to the feed.
1024</p>
1025<p>When the launched process exits, <code>ffserver</code> will launch
1026another program instance.
1027</p>
1028<p>In case you need a more complex <code>ffmpeg</code> configuration,
1029e.g. if you need to generate multiple FFM feeds with a single
1030<code>ffmpeg</code> instance, you should launch <code>ffmpeg</code> by hand.
1031</p>
1032<p>This option is ignored in case the commandline option <samp>-n</samp> is
1033specified.
1034</p>
1035</dd>
1036<dt><samp>ACL <var>spec</var></samp></dt>
1037<dd><p>Specify the list of IP address which are allowed or denied to write
1038the feed. Multiple ACL options can be specified.
1039</p></dd>
1040</dl>
1041
1042<a name="Stream-section"></a>
1043<h3 class="section">5.4 Stream section</h3>
1044
1045<p>A Stream section defines a stream provided by <code>ffserver</code>, and
1046identified by a single name.
1047</p>
1048<p>The stream is sent when answering a request containing the stream
1049name.
1050</p>
1051<p>A stream section must be introduced by the line:
1052</p><div class="example">
1053<pre class="example">&lt;Stream STREAM_NAME&gt;
1054</pre></div>
1055
1056<p>where <var>STREAM_NAME</var> specifies the unique name of the stream.
1057</p>
1058<p>The following options are recognized within a Stream section.
1059</p>
1060<p>Encoding options are marked with the <em>encoding</em> tag, and they are
1061used to set the encoding parameters, and are mapped to libavcodec
1062encoding options. Not all encoding options are supported, in
1063particular it is not possible to set encoder private options. In order
1064to override the encoding options specified by <code>ffserver</code>, you
1065can use the <code>ffmpeg</code> <samp>override_ffserver</samp> commandline
1066option.
1067</p>
1068<p>Only one of the <samp>Feed</samp> and <samp>File</samp> options should be set.
1069</p>
1070<dl compact="compact">
1071<dt><samp>Feed <var>feed_name</var></samp></dt>
1072<dd><p>Set the input feed. <var>feed_name</var> must correspond to an existing
1073feed defined in a <code>Feed</code> section.
1074</p>
1075<p>When this option is set, encoding options are used to setup the
1076encoding operated by the remote <code>ffmpeg</code> process.
1077</p>
1078</dd>
1079<dt><samp>File <var>filename</var></samp></dt>
1080<dd><p>Set the filename of the pre-recorded input file to stream.
1081</p>
1082<p>When this option is set, encoding options are ignored and the input
1083file content is re-streamed as is.
1084</p>
1085</dd>
1086<dt><samp>Format <var>format_name</var></samp></dt>
1087<dd><p>Set the format of the output stream.
1088</p>
1089<p>Must be the name of a format recognized by FFmpeg. If set to
1090&lsquo;<samp>status</samp>&rsquo;, it is treated as a status stream.
1091</p>
1092</dd>
1093<dt><samp>InputFormat <var>format_name</var></samp></dt>
1094<dd><p>Set input format. If not specified, it is automatically guessed.
1095</p>
1096</dd>
1097<dt><samp>Preroll <var>n</var></samp></dt>
1098<dd><p>Set this to the number of seconds backwards in time to start. Note that
1099most players will buffer 5-10 seconds of video, and also you need to allow
1100for a keyframe to appear in the data stream.
1101</p>
1102<p>Default value is 0.
1103</p>
1104</dd>
1105<dt><samp>StartSendOnKey</samp></dt>
1106<dd><p>Do not send stream until it gets the first key frame. By default
1107<code>ffserver</code> will send data immediately.
1108</p>
1109</dd>
1110<dt><samp>MaxTime <var>n</var></samp></dt>
1111<dd><p>Set the number of seconds to run. This value set the maximum duration
1112of the stream a client will be able to receive.
1113</p>
1114<p>A value of 0 means that no limit is set on the stream duration.
1115</p>
1116</dd>
1117<dt><samp>ACL <var>spec</var></samp></dt>
1118<dd><p>Set ACL for the stream.
1119</p>
1120</dd>
1121<dt><samp>DynamicACL <var>spec</var></samp></dt>
1122<dt><samp>RTSPOption <var>option</var></samp></dt>
1123<dt><samp>MulticastAddress <var>address</var></samp></dt>
1124<dt><samp>MulticastPort <var>port</var></samp></dt>
1125<dt><samp>MulticastTTL <var>integer</var></samp></dt>
1126<dt><samp>NoLoop</samp></dt>
1127<dt><samp>FaviconURL <var>url</var></samp></dt>
1128<dd><p>Set favicon (favourite icon) for the server status page. It is ignored
1129for regular streams.
1130</p>
1131</dd>
1132<dt><samp>Author <var>value</var></samp></dt>
1133<dt><samp>Comment <var>value</var></samp></dt>
1134<dt><samp>Copyright <var>value</var></samp></dt>
1135<dt><samp>Title <var>value</var></samp></dt>
1136<dd><p>Set metadata corresponding to the option. All these options are
1137deprecated in favor of <samp>Metadata</samp>.
1138</p>
1139</dd>
1140<dt><samp>Metadata <var>key</var> <var>value</var></samp></dt>
1141<dd><p>Set metadata value on the output stream.
1142</p>
1143</dd>
1144<dt><samp>UseDefaults</samp></dt>
1145<dt><samp>NoDefaults</samp></dt>
1146<dd><p>Control whether default codec options are used for the stream or not.
1147Default is <var>UseDefaults</var> unless disabled globally.
1148</p>
1149</dd>
1150<dt><samp>NoAudio</samp></dt>
1151<dt><samp>NoVideo</samp></dt>
1152<dd><p>Suppress audio/video.
1153</p>
1154</dd>
1155<dt><samp>AudioCodec <var>codec_name</var> (<em>encoding,audio</em>)</samp></dt>
1156<dd><p>Set audio codec.
1157</p>
1158</dd>
1159<dt><samp>AudioBitRate <var>rate</var> (<em>encoding,audio</em>)</samp></dt>
1160<dd><p>Set bitrate for the audio stream in kbits per second.
1161</p>
1162</dd>
1163<dt><samp>AudioChannels <var>n</var> (<em>encoding,audio</em>)</samp></dt>
1164<dd><p>Set number of audio channels.
1165</p>
1166</dd>
1167<dt><samp>AudioSampleRate <var>n</var> (<em>encoding,audio</em>)</samp></dt>
1168<dd><p>Set sampling frequency for audio. When using low bitrates, you should
1169lower this frequency to 22050 or 11025. The supported frequencies
1170depend on the selected audio codec.
1171</p>
1172</dd>
1173<dt><samp>AVOptionAudio [<var>codec</var>:]<var>option</var> <var>value</var> (<em>encoding,audio</em>)</samp></dt>
1174<dd><p>Set generic or private option for audio stream.
1175Private option must be prefixed with codec name or codec must be defined before.
1176</p>
1177</dd>
1178<dt><samp>AVPresetAudio <var>preset</var> (<em>encoding,audio</em>)</samp></dt>
1179<dd><p>Set preset for audio stream.
1180</p>
1181</dd>
1182<dt><samp>VideoCodec <var>codec_name</var> (<em>encoding,video</em>)</samp></dt>
1183<dd><p>Set video codec.
1184</p>
1185</dd>
1186<dt><samp>VideoBitRate <var>n</var> (<em>encoding,video</em>)</samp></dt>
1187<dd><p>Set bitrate for the video stream in kbits per second.
1188</p>
1189</dd>
1190<dt><samp>VideoBitRateRange <var>range</var> (<em>encoding,video</em>)</samp></dt>
1191<dd><p>Set video bitrate range.
1192</p>
1193<p>A range must be specified in the form <var>minrate</var>-<var>maxrate</var>, and
1194specifies the <samp>minrate</samp> and <samp>maxrate</samp> encoding options
1195expressed in kbits per second.
1196</p>
1197</dd>
1198<dt><samp>VideoBitRateRangeTolerance <var>n</var> (<em>encoding,video</em>)</samp></dt>
1199<dd><p>Set video bitrate tolerance in kbits per second.
1200</p>
1201</dd>
1202<dt><samp>PixelFormat <var>pixel_format</var> (<em>encoding,video</em>)</samp></dt>
1203<dd><p>Set video pixel format.
1204</p>
1205</dd>
1206<dt><samp>Debug <var>integer</var> (<em>encoding,video</em>)</samp></dt>
1207<dd><p>Set video <samp>debug</samp> encoding option.
1208</p>
1209</dd>
1210<dt><samp>Strict <var>integer</var> (<em>encoding,video</em>)</samp></dt>
1211<dd><p>Set video <samp>strict</samp> encoding option.
1212</p>
1213</dd>
1214<dt><samp>VideoBufferSize <var>n</var> (<em>encoding,video</em>)</samp></dt>
1215<dd><p>Set ratecontrol buffer size, expressed in KB.
1216</p>
1217</dd>
1218<dt><samp>VideoFrameRate <var>n</var> (<em>encoding,video</em>)</samp></dt>
1219<dd><p>Set number of video frames per second.
1220</p>
1221</dd>
1222<dt><samp>VideoSize (<em>encoding,video</em>)</samp></dt>
1223<dd><p>Set size of the video frame, must be an abbreviation or in the form
1224<var>W</var>x<var>H</var>.  See <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)the Video size section
1225in the ffmpeg-utils(1) manual</a>.
1226</p>
1227<p>Default value is <code>160x128</code>.
1228</p>
1229</dd>
1230<dt><samp>VideoIntraOnly (<em>encoding,video</em>)</samp></dt>
1231<dd><p>Transmit only intra frames (useful for low bitrates, but kills frame rate).
1232</p>
1233</dd>
1234<dt><samp>VideoGopSize <var>n</var> (<em>encoding,video</em>)</samp></dt>
1235<dd><p>If non-intra only, an intra frame is transmitted every VideoGopSize
1236frames. Video synchronization can only begin at an intra frame.
1237</p>
1238</dd>
1239<dt><samp>VideoTag <var>tag</var> (<em>encoding,video</em>)</samp></dt>
1240<dd><p>Set video tag.
1241</p>
1242</dd>
1243<dt><samp>VideoHighQuality (<em>encoding,video</em>)</samp></dt>
1244<dt><samp>Video4MotionVector (<em>encoding,video</em>)</samp></dt>
1245<dt><samp>BitExact (<em>encoding,video</em>)</samp></dt>
1246<dd><p>Set bitexact encoding flag.
1247</p>
1248</dd>
1249<dt><samp>IdctSimple (<em>encoding,video</em>)</samp></dt>
1250<dd><p>Set simple IDCT algorithm.
1251</p>
1252</dd>
1253<dt><samp>Qscale <var>n</var> (<em>encoding,video</em>)</samp></dt>
1254<dd><p>Enable constant quality encoding, and set video qscale (quantization
1255scale) value, expressed in <var>n</var> QP units.
1256</p>
1257</dd>
1258<dt><samp>VideoQMin <var>n</var> (<em>encoding,video</em>)</samp></dt>
1259<dt><samp>VideoQMax <var>n</var> (<em>encoding,video</em>)</samp></dt>
1260<dd><p>Set video qmin/qmax.
1261</p>
1262</dd>
1263<dt><samp>VideoQDiff <var>integer</var> (<em>encoding,video</em>)</samp></dt>
1264<dd><p>Set video <samp>qdiff</samp> encoding option.
1265</p>
1266</dd>
1267<dt><samp>LumiMask <var>float</var> (<em>encoding,video</em>)</samp></dt>
1268<dt><samp>DarkMask <var>float</var> (<em>encoding,video</em>)</samp></dt>
1269<dd><p>Set <samp>lumi_mask</samp>/<samp>dark_mask</samp> encoding options.
1270</p>
1271</dd>
1272<dt><samp>AVOptionVideo [<var>codec</var>:]<var>option</var> <var>value</var> (<em>encoding,video</em>)</samp></dt>
1273<dd><p>Set generic or private option for video stream.
1274Private option must be prefixed with codec name or codec must be defined before.
1275</p>
1276</dd>
1277<dt><samp>AVPresetVideo <var>preset</var> (<em>encoding,video</em>)</samp></dt>
1278<dd><p>Set preset for video stream.
1279</p>
1280<p><var>preset</var> must be the path of a preset file.
1281</p></dd>
1282</dl>
1283
1284<a name="Server-status-stream"></a>
1285<h4 class="subsection">5.4.1 Server status stream</h4>
1286
1287<p>A server status stream is a special stream which is used to show
1288statistics about the <code>ffserver</code> operations.
1289</p>
1290<p>It must be specified setting the option <samp>Format</samp> to
1291&lsquo;<samp>status</samp>&rsquo;.
1292</p>
1293<a name="Redirect-section"></a>
1294<h3 class="section">5.5 Redirect section</h3>
1295
1296<p>A redirect section specifies where to redirect the requested URL to
1297another page.
1298</p>
1299<p>A redirect section must be introduced by the line:
1300</p><div class="example">
1301<pre class="example">&lt;Redirect NAME&gt;
1302</pre></div>
1303
1304<p>where <var>NAME</var> is the name of the page which should be redirected.
1305</p>
1306<p>It only accepts the option <samp>URL</samp>, which specify the redirection
1307URL.
1308</p>
1309<a name="Stream-examples"></a>
1310<h2 class="chapter">6 Stream examples</h2>
1311
1312<ul>
1313<li> Multipart JPEG
1314<div class="example">
1315<pre class="example">&lt;Stream test.mjpg&gt;
1316Feed feed1.ffm
1317Format mpjpeg
1318VideoFrameRate 2
1319VideoIntraOnly
1320NoAudio
1321Strict -1
1322&lt;/Stream&gt;
1323</pre></div>
1324
1325</li><li> Single JPEG
1326<div class="example">
1327<pre class="example">&lt;Stream test.jpg&gt;
1328Feed feed1.ffm
1329Format jpeg
1330VideoFrameRate 2
1331VideoIntraOnly
1332VideoSize 352x240
1333NoAudio
1334Strict -1
1335&lt;/Stream&gt;
1336</pre></div>
1337
1338</li><li> Flash
1339<div class="example">
1340<pre class="example">&lt;Stream test.swf&gt;
1341Feed feed1.ffm
1342Format swf
1343VideoFrameRate 2
1344VideoIntraOnly
1345NoAudio
1346&lt;/Stream&gt;
1347</pre></div>
1348
1349</li><li> ASF compatible
1350<div class="example">
1351<pre class="example">&lt;Stream test.asf&gt;
1352Feed feed1.ffm
1353Format asf
1354VideoFrameRate 15
1355VideoSize 352x240
1356VideoBitRate 256
1357VideoBufferSize 40
1358VideoGopSize 30
1359AudioBitRate 64
1360StartSendOnKey
1361&lt;/Stream&gt;
1362</pre></div>
1363
1364</li><li> MP3 audio
1365<div class="example">
1366<pre class="example">&lt;Stream test.mp3&gt;
1367Feed feed1.ffm
1368Format mp2
1369AudioCodec mp3
1370AudioBitRate 64
1371AudioChannels 1
1372AudioSampleRate 44100
1373NoVideo
1374&lt;/Stream&gt;
1375</pre></div>
1376
1377</li><li> Ogg Vorbis audio
1378<div class="example">
1379<pre class="example">&lt;Stream test.ogg&gt;
1380Feed feed1.ffm
1381Metadata title &quot;Stream title&quot;
1382AudioBitRate 64
1383AudioChannels 2
1384AudioSampleRate 44100
1385NoVideo
1386&lt;/Stream&gt;
1387</pre></div>
1388
1389</li><li> Real with audio only at 32 kbits
1390<div class="example">
1391<pre class="example">&lt;Stream test.ra&gt;
1392Feed feed1.ffm
1393Format rm
1394AudioBitRate 32
1395NoVideo
1396&lt;/Stream&gt;
1397</pre></div>
1398
1399</li><li> Real with audio and video at 64 kbits
1400<div class="example">
1401<pre class="example">&lt;Stream test.rm&gt;
1402Feed feed1.ffm
1403Format rm
1404AudioBitRate 32
1405VideoBitRate 128
1406VideoFrameRate 25
1407VideoGopSize 25
1408&lt;/Stream&gt;
1409</pre></div>
1410
1411</li><li> For stream coming from a file: you only need to set the input filename
1412and optionally a new format.
1413
1414<div class="example">
1415<pre class="example">&lt;Stream file.rm&gt;
1416File &quot;/usr/local/httpd/htdocs/tlive.rm&quot;
1417NoAudio
1418&lt;/Stream&gt;
1419</pre></div>
1420
1421<div class="example">
1422<pre class="example">&lt;Stream file.asf&gt;
1423File &quot;/usr/local/httpd/htdocs/test.asf&quot;
1424NoAudio
1425Metadata author &quot;Me&quot;
1426Metadata copyright &quot;Super MegaCorp&quot;
1427Metadata title &quot;Test stream from disk&quot;
1428Metadata comment &quot;Test comment&quot;
1429&lt;/Stream&gt;
1430</pre></div>
1431</li></ul>
1432
1433
1434
1435<a name="See-Also"></a>
1436<h2 class="chapter">7 See Also</h2>
1437
1438<p>the <samp>doc/ffserver.conf</samp> example,
1439<a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
1440<a href="ffmpeg-utils.html">ffmpeg-utils</a>,
1441<a href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
1442<a href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
1443<a href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
1444<a href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
1445<a href="ffmpeg-formats.html">ffmpeg-formats</a>,
1446<a href="ffmpeg-devices.html">ffmpeg-devices</a>,
1447<a href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
1448<a href="ffmpeg-filters.html">ffmpeg-filters</a>
1449</p>
1450
1451<a name="Authors"></a>
1452<h2 class="chapter">8 Authors</h2>
1453
1454<p>The FFmpeg developers.
1455</p>
1456<p>For details about the authorship, see the Git history of the project
1457(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
1458<code>git log</code> in the FFmpeg source directory, or browsing the
1459online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
1460</p>
1461<p>Maintainers for the specific components are listed in the file
1462<samp>MAINTAINERS</samp> in the source code tree.
1463</p>
1464
1465<hr>
1466
1467
1468
1469</body>
1470</html>