| 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 | <!--
|
|---|
| 16 | a.summary-letter {text-decoration: none}
|
|---|
| 17 | blockquote.indentedblock {margin-right: 0em}
|
|---|
| 18 | blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
|
|---|
| 19 | blockquote.smallquotation {font-size: smaller}
|
|---|
| 20 | div.display {margin-left: 3.2em}
|
|---|
| 21 | div.example {margin-left: 3.2em}
|
|---|
| 22 | div.lisp {margin-left: 3.2em}
|
|---|
| 23 | div.smalldisplay {margin-left: 3.2em}
|
|---|
| 24 | div.smallexample {margin-left: 3.2em}
|
|---|
| 25 | div.smalllisp {margin-left: 3.2em}
|
|---|
| 26 | kbd {font-style: oblique}
|
|---|
| 27 | pre.display {font-family: inherit}
|
|---|
| 28 | pre.format {font-family: inherit}
|
|---|
| 29 | pre.menu-comment {font-family: serif}
|
|---|
| 30 | pre.menu-preformatted {font-family: serif}
|
|---|
| 31 | pre.smalldisplay {font-family: inherit; font-size: smaller}
|
|---|
| 32 | pre.smallexample {font-size: smaller}
|
|---|
| 33 | pre.smallformat {font-family: inherit; font-size: smaller}
|
|---|
| 34 | pre.smalllisp {font-size: smaller}
|
|---|
| 35 | span.nolinebreak {white-space: nowrap}
|
|---|
| 36 | span.roman {font-family: initial; font-weight: normal}
|
|---|
| 37 | span.sansserif {font-family: sans-serif; font-weight: normal}
|
|---|
| 38 | ul.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.
|
|---|
| 103 | It supports several live feeds, streaming from files and time shifting
|
|---|
| 104 | on live feeds. You can seek to positions in the past on each live
|
|---|
| 105 | feed, provided you specify a big enough feed storage.
|
|---|
| 106 | </p>
|
|---|
| 107 | <p><code>ffserver</code> is configured through a configuration file, which
|
|---|
| 108 | is 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
|
|---|
| 113 | RTP/RTSP/HTTP.
|
|---|
| 114 | </p>
|
|---|
| 115 | <p>An <code>ffserver</code> instance will listen on some port as specified
|
|---|
| 116 | in 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
|
|---|
| 118 | ffserver 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><Feed></code> section in the configuration file.
|
|---|
| 123 | </p>
|
|---|
| 124 | <p>For each feed you can have different output streams in various
|
|---|
| 125 | formats, each one specified by a <code><Stream></code> section in the
|
|---|
| 126 | configuration 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
|
|---|
| 135 | requests from <code>ffmpeg</code> to acquire the stream to publish, and
|
|---|
| 136 | serving RTSP clients or HTTP clients GET requests with the stream
|
|---|
| 137 | media content.
|
|---|
| 138 | </p>
|
|---|
| 139 | <p>A feed is an <a href="#FFM">FFM</a> stream created by <code>ffmpeg</code>, and sent to
|
|---|
| 140 | a port where <code>ffserver</code> is listening.
|
|---|
| 141 | </p>
|
|---|
| 142 | <p>Each feed is identified by a unique name, corresponding to the name
|
|---|
| 143 | of the resource published on <code>ffserver</code>, and is configured by
|
|---|
| 144 | a 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
|
|---|
| 153 | the 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
|
|---|
| 155 | configuration file.
|
|---|
| 156 | </p>
|
|---|
| 157 | <p>Each feed is associated to a file which is stored on disk. This stored
|
|---|
| 158 | file is used to send pre-recorded data to a player as fast as
|
|---|
| 159 | possible when new content is added in real-time to the stream.
|
|---|
| 160 | </p>
|
|---|
| 161 | <p>A "live-stream" or "stream" is a resource published by
|
|---|
| 162 | <code>ffserver</code>, and made accessible through the HTTP protocol to
|
|---|
| 163 | clients.
|
|---|
| 164 | </p>
|
|---|
| 165 | <p>A stream can be connected to a feed, or to a file. In the first case,
|
|---|
| 166 | the published stream is forwarded from the corresponding feed
|
|---|
| 167 | generated by a running instance of <code>ffmpeg</code>, in the second
|
|---|
| 168 | case 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
|
|---|
| 171 | of the resource served by <code>ffserver</code>, and is configured by
|
|---|
| 172 | a 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
|
|---|
| 185 | the configuration file. <var>options</var> is a list of options specified
|
|---|
| 186 | after 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
|
|---|
| 188 | and 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
|
|---|
| 192 | must 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
|
|---|
| 195 | the <code>ffmpeg</code> encoders.
|
|---|
| 196 | </p>
|
|---|
| 197 | <p>The <code>ffmpeg</code> <samp>override_ffserver</samp> commandline option
|
|---|
| 198 | allows 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
|
|---|
| 203 | graph:
|
|---|
| 204 | </p>
|
|---|
| 205 | <pre class="verbatim"> _________ __________
|
|---|
| 206 | | | | |
|
|---|
| 207 | ffmpeg 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 | | | | |
|
|---|
| 222 | ffmpeg 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
|
|---|
| 235 | video and audio streams and encoding options, and can store a moving time segment
|
|---|
| 236 | of an infinite movie or a whole movie.
|
|---|
| 237 | </p>
|
|---|
| 238 | <p>FFM is version specific, and there is limited compatibility of FFM files
|
|---|
| 239 | generated by one version of ffmpeg/ffserver and another version of
|
|---|
| 240 | ffmpeg/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
|
|---|
| 243 | differing 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
|
|---|
| 249 | current status of the server.
|
|---|
| 250 | </p>
|
|---|
| 251 | <p>Simply point your browser to the address of the special status stream
|
|---|
| 252 | specified in the configuration file.
|
|---|
| 253 | </p>
|
|---|
| 254 | <p>For example if you have:
|
|---|
| 255 | </p><div class="example">
|
|---|
| 256 | <pre class="example"><Stream status.html>
|
|---|
| 257 | Format status
|
|---|
| 258 |
|
|---|
| 259 | # Only allow local people to get the status
|
|---|
| 260 | ACL allow localhost
|
|---|
| 261 | ACL allow 192.168.0.0 192.168.255.255
|
|---|
| 262 | </Stream>
|
|---|
| 263 | </pre></div>
|
|---|
| 264 |
|
|---|
| 265 | <p>then the server will post a page with the status information when
|
|---|
| 266 | the 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
|
|---|
| 272 | is some file which you can decode with ffmpeg:
|
|---|
| 273 | </p>
|
|---|
| 274 | <div class="example">
|
|---|
| 275 | <pre class="example">ffserver -f doc/ffserver.conf &
|
|---|
| 276 | ffmpeg -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
|
|---|
| 280 | Windows Media Player (WMP). Go to Open URL and enter
|
|---|
| 281 | </p>
|
|---|
| 282 | <div class="example">
|
|---|
| 283 | <pre class="example"> http://<linuxbox>: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’t work with WMP as it tries to
|
|---|
| 289 | transfer the entire file before starting to play.
|
|---|
| 290 | The same is true of AVI files.
|
|---|
| 291 | </p>
|
|---|
| 292 | <p>You should edit the <samp>ffserver.conf</samp> file to suit your needs (in
|
|---|
| 293 | terms 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.
|
|---|
| 300 | However, there are a number of caveats, including the fact that the
|
|---|
| 301 | ffserver parameters must match the original parameters used to record the
|
|---|
| 302 | file. 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
|
|---|
| 306 | there are a bunch more parameters that you cannot control. Post a message
|
|---|
| 307 | to the mailing list if there are some ’must have’ parameters. Look in
|
|---|
| 308 | ffserver.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
|
|---|
| 311 | in browsers. These files are actually redirections to the underlying ASF
|
|---|
| 312 | or RM file. The reason for this is that the browser often fetches the
|
|---|
| 313 | entire file before starting up the external viewer. The redirection files
|
|---|
| 314 | are very small and can be transferred quickly. [The stream itself is
|
|---|
| 315 | often ’infinite’ and thus the browser tries to download it and never
|
|---|
| 316 | finishes.]
|
|---|
| 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
|
|---|
| 322 | buffer a certain number of seconds of material so that they can display the
|
|---|
| 323 | signal continuously. However, ffserver (by default) starts sending data
|
|---|
| 324 | in realtime. This means that there is a pause of a few seconds while the
|
|---|
| 325 | buffering is being done by the player. The good news is that this can be
|
|---|
| 326 | cured by adding a ’?buffer=5’ to the end of the URL. This means that the
|
|---|
| 327 | stream should start 5 seconds in the past – and so the first 5 seconds
|
|---|
| 328 | of the stream are sent as fast as the network will allow. It will then
|
|---|
| 329 | slow down to real time. This noticeably improves the startup experience.
|
|---|
| 330 | </p>
|
|---|
| 331 | <p>You can also add a ’Preroll 15’ statement into the ffserver.conf that will
|
|---|
| 332 | add the 15 second prebuffering on all requests that do not otherwise
|
|---|
| 333 | specify a time. In addition, ffserver will skip frames until a key_frame
|
|---|
| 334 | is found. This further reduces the startup delay by not transferring data
|
|---|
| 335 | that 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
|
|---|
| 341 | grabbed is marginally less than the number that ought to be grabbed. This
|
|---|
| 342 | means that the timestamp in the encoded data stream gets behind realtime.
|
|---|
| 343 | This means that if you say ’Preroll 10’, then when the stream gets 10
|
|---|
| 344 | or more seconds behind, there is no Preroll left.
|
|---|
| 345 | </p>
|
|---|
| 346 | <p>Fixing this requires a change in the internals of how timestamps are
|
|---|
| 347 | handled.
|
|---|
| 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
|
|---|
| 353 | start ffserver, it deletes the ffm file (if any parameters have changed),
|
|---|
| 354 | thus 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
|
|---|
| 357 | of the following formats (the ’T’ 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
|
|---|
| 365 | note that ‘<samp>?date=16:00:00</samp>’ refers to 16:00 on the current day – this
|
|---|
| 366 | may 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.
|
|---|
| 369 | For example: ‘<samp>http://localhost:8080/test.asf?date=2002-07-26T23:05:00</samp>’.
|
|---|
| 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
|
|---|
| 375 | representing a number as input, which may be followed by one of the SI
|
|---|
| 376 | unit prefixes, for example: ’K’, ’M’, or ’G’.
|
|---|
| 377 | </p>
|
|---|
| 378 | <p>If ’i’ is appended to the SI unit prefix, the complete prefix will be
|
|---|
| 379 | interpreted as a unit prefix for binary multiples, which are based on
|
|---|
| 380 | powers of 1024 instead of powers of 1000. Appending ’B’ to the SI unit
|
|---|
| 381 | prefix multiplies the value by 8. This allows using, for example:
|
|---|
| 382 | ’KB’, ’MiB’, ’G’ and ’B’ as number suffixes.
|
|---|
| 383 | </p>
|
|---|
| 384 | <p>Options which do not take arguments are boolean options, and set the
|
|---|
| 385 | corresponding value to true. They can be set to false by prefixing
|
|---|
| 386 | the option name with "no". For example using "-nofoo"
|
|---|
| 387 | will set the boolean option with name "foo" 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
|
|---|
| 392 | are 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
|
|---|
| 395 | separated 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
|
|---|
| 397 | would 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
|
|---|
| 400 | of them. E.g. the stream specifier in <code>-b:a 128k</code> matches all audio
|
|---|
| 401 | streams.
|
|---|
| 402 | </p>
|
|---|
| 403 | <p>An empty stream specifier matches all streams. For example, <code>-codec copy</code>
|
|---|
| 404 | or <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
|
|---|
| 410 | thread 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: ’v’ or ’V’ for video, ’a’ for audio, ’s’
|
|---|
| 414 | for subtitle, ’d’ for data, and ’t’ for attachments. ’v’ matches all video
|
|---|
| 415 | streams, ’V’ only matches video streams which are not attached pictures, video
|
|---|
| 416 | thumbnails or cover arts. If <var>stream_index</var> is given, then it matches
|
|---|
| 417 | stream number <var>stream_index</var> of this type. Otherwise, it matches all
|
|---|
| 418 | streams 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>
|
|---|
| 422 | in the program with the id <var>program_id</var>. Otherwise, it matches all streams in the
|
|---|
| 423 | program.
|
|---|
| 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
|
|---|
| 431 | value.
|
|---|
| 432 | </p></dd>
|
|---|
| 433 | <dt><samp>u</samp></dt>
|
|---|
| 434 | <dd><p>Matches streams with usable configuration, the codec must be defined and the
|
|---|
| 435 | essential 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
|
|---|
| 438 | input 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
|
|---|
| 454 | item. If no argument is specified, only basic (non advanced) tool
|
|---|
| 455 | options 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
|
|---|
| 465 | for 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 ’codec’ is used throughout this documentation as a shortcut
|
|---|
| 519 | for 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.
|
|---|
| 560 | Some devices may provide system-dependent source names that cannot be autodetected.
|
|---|
| 561 | The 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.
|
|---|
| 569 | Some devices may provide system-dependent sink names that cannot be autodetected.
|
|---|
| 570 | The 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.
|
|---|
| 578 | Adding "repeat+" indicates that repeated log output should not be compressed
|
|---|
| 579 | to the first line and the "Last message repeated n times" line will be
|
|---|
| 580 | omitted. "repeat" can also be used alone.
|
|---|
| 581 | If "repeat" is used alone, and with no prior loglevel set, the default
|
|---|
| 582 | loglevel will be used. If multiple loglevel parameters are given, using
|
|---|
| 583 | ’repeat’ 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>‘<samp>quiet, -8</samp>’</dt>
|
|---|
| 587 | <dd><p>Show nothing at all; be silent.
|
|---|
| 588 | </p></dd>
|
|---|
| 589 | <dt>‘<samp>panic, 0</samp>’</dt>
|
|---|
| 590 | <dd><p>Only show fatal errors which could lead the process to crash, such as
|
|---|
| 591 | an assertion failure. This is not currently used for anything.
|
|---|
| 592 | </p></dd>
|
|---|
| 593 | <dt>‘<samp>fatal, 8</samp>’</dt>
|
|---|
| 594 | <dd><p>Only show fatal errors. These are errors after which the process absolutely
|
|---|
| 595 | cannot continue.
|
|---|
| 596 | </p></dd>
|
|---|
| 597 | <dt>‘<samp>error, 16</samp>’</dt>
|
|---|
| 598 | <dd><p>Show all errors, including ones which can be recovered from.
|
|---|
| 599 | </p></dd>
|
|---|
| 600 | <dt>‘<samp>warning, 24</samp>’</dt>
|
|---|
| 601 | <dd><p>Show all warnings and errors. Any message related to possibly
|
|---|
| 602 | incorrect or unexpected events will be shown.
|
|---|
| 603 | </p></dd>
|
|---|
| 604 | <dt>‘<samp>info, 32</samp>’</dt>
|
|---|
| 605 | <dd><p>Show informative messages during processing. This is in addition to
|
|---|
| 606 | warnings and errors. This is the default value.
|
|---|
| 607 | </p></dd>
|
|---|
| 608 | <dt>‘<samp>verbose, 40</samp>’</dt>
|
|---|
| 609 | <dd><p>Same as <code>info</code>, except more verbose.
|
|---|
| 610 | </p></dd>
|
|---|
| 611 | <dt>‘<samp>debug, 48</samp>’</dt>
|
|---|
| 612 | <dd><p>Show everything, including debugging information.
|
|---|
| 613 | </p></dd>
|
|---|
| 614 | <dt>‘<samp>trace, 56</samp>’</dt>
|
|---|
| 615 | </dl>
|
|---|
| 616 |
|
|---|
| 617 | <p>By default the program logs to stderr. If coloring is supported by the
|
|---|
| 618 | terminal, colors are used to mark errors and warnings. Log coloring
|
|---|
| 619 | can be disabled setting the environment variable
|
|---|
| 620 | <code>AV_LOG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
|
|---|
| 621 | the environment variable <code>AV_LOG_FORCE_COLOR</code>.
|
|---|
| 622 | The use of the environment variable <code>NO_COLOR</code> is deprecated and
|
|---|
| 623 | will 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
|
|---|
| 629 | directory.
|
|---|
| 630 | This file can be useful for bug reports.
|
|---|
| 631 | It also implies <code>-loglevel verbose</code>.
|
|---|
| 632 | </p>
|
|---|
| 633 | <p>Setting the environment variable <code>FFREPORT</code> to any value has the
|
|---|
| 634 | same effect. If the value is a ’:’-separated key=value sequence, these
|
|---|
| 635 | options will affect the report; option values must be escaped if they
|
|---|
| 636 | contain special characters or the options delimiter ’:’ (see the
|
|---|
| 637 | “Quoting and escaping” 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
|
|---|
| 643 | of the program, <code>%t</code> is expanded to a timestamp, <code>%%</code> is expanded
|
|---|
| 644 | to 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>
|
|---|
| 652 | using 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
|
|---|
| 659 | appear 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
|
|---|
| 666 | and library versions. This option can be used to suppress printing
|
|---|
| 667 | this 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
|
|---|
| 672 | for testing. Do not use it unless you know what you’re doing.
|
|---|
| 673 | </p><div class="example">
|
|---|
| 674 | <pre class="example">ffmpeg -cpuflags -sse+mmx ...
|
|---|
| 675 | ffmpeg -cpuflags mmx ...
|
|---|
| 676 | ffmpeg -cpuflags 0 ...
|
|---|
| 677 | </pre></div>
|
|---|
| 678 | <p>Possible flags for this option are:
|
|---|
| 679 | </p><dl compact="compact">
|
|---|
| 680 | <dt>‘<samp>x86</samp>’</dt>
|
|---|
| 681 | <dd><dl compact="compact">
|
|---|
| 682 | <dt>‘<samp>mmx</samp>’</dt>
|
|---|
| 683 | <dt>‘<samp>mmxext</samp>’</dt>
|
|---|
| 684 | <dt>‘<samp>sse</samp>’</dt>
|
|---|
| 685 | <dt>‘<samp>sse2</samp>’</dt>
|
|---|
| 686 | <dt>‘<samp>sse2slow</samp>’</dt>
|
|---|
| 687 | <dt>‘<samp>sse3</samp>’</dt>
|
|---|
| 688 | <dt>‘<samp>sse3slow</samp>’</dt>
|
|---|
| 689 | <dt>‘<samp>ssse3</samp>’</dt>
|
|---|
| 690 | <dt>‘<samp>atom</samp>’</dt>
|
|---|
| 691 | <dt>‘<samp>sse4.1</samp>’</dt>
|
|---|
| 692 | <dt>‘<samp>sse4.2</samp>’</dt>
|
|---|
| 693 | <dt>‘<samp>avx</samp>’</dt>
|
|---|
| 694 | <dt>‘<samp>avx2</samp>’</dt>
|
|---|
| 695 | <dt>‘<samp>xop</samp>’</dt>
|
|---|
| 696 | <dt>‘<samp>fma3</samp>’</dt>
|
|---|
| 697 | <dt>‘<samp>fma4</samp>’</dt>
|
|---|
| 698 | <dt>‘<samp>3dnow</samp>’</dt>
|
|---|
| 699 | <dt>‘<samp>3dnowext</samp>’</dt>
|
|---|
| 700 | <dt>‘<samp>bmi1</samp>’</dt>
|
|---|
| 701 | <dt>‘<samp>bmi2</samp>’</dt>
|
|---|
| 702 | <dt>‘<samp>cmov</samp>’</dt>
|
|---|
| 703 | </dl>
|
|---|
| 704 | </dd>
|
|---|
| 705 | <dt>‘<samp>ARM</samp>’</dt>
|
|---|
| 706 | <dd><dl compact="compact">
|
|---|
| 707 | <dt>‘<samp>armv5te</samp>’</dt>
|
|---|
| 708 | <dt>‘<samp>armv6</samp>’</dt>
|
|---|
| 709 | <dt>‘<samp>armv6t2</samp>’</dt>
|
|---|
| 710 | <dt>‘<samp>vfp</samp>’</dt>
|
|---|
| 711 | <dt>‘<samp>vfpv3</samp>’</dt>
|
|---|
| 712 | <dt>‘<samp>neon</samp>’</dt>
|
|---|
| 713 | <dt>‘<samp>setend</samp>’</dt>
|
|---|
| 714 | </dl>
|
|---|
| 715 | </dd>
|
|---|
| 716 | <dt>‘<samp>AArch64</samp>’</dt>
|
|---|
| 717 | <dd><dl compact="compact">
|
|---|
| 718 | <dt>‘<samp>armv8</samp>’</dt>
|
|---|
| 719 | <dt>‘<samp>vfp</samp>’</dt>
|
|---|
| 720 | <dt>‘<samp>neon</samp>’</dt>
|
|---|
| 721 | </dl>
|
|---|
| 722 | </dd>
|
|---|
| 723 | <dt>‘<samp>PowerPC</samp>’</dt>
|
|---|
| 724 | <dd><dl compact="compact">
|
|---|
| 725 | <dt>‘<samp>altivec</samp>’</dt>
|
|---|
| 726 | </dl>
|
|---|
| 727 | </dd>
|
|---|
| 728 | <dt>‘<samp>Specific Processors</samp>’</dt>
|
|---|
| 729 | <dd><dl compact="compact">
|
|---|
| 730 | <dt>‘<samp>pentium2</samp>’</dt>
|
|---|
| 731 | <dt>‘<samp>pentium3</samp>’</dt>
|
|---|
| 732 | <dt>‘<samp>pentium4</samp>’</dt>
|
|---|
| 733 | <dt>‘<samp>k6</samp>’</dt>
|
|---|
| 734 | <dt>‘<samp>k62</samp>’</dt>
|
|---|
| 735 | <dt>‘<samp>athlon</samp>’</dt>
|
|---|
| 736 | <dt>‘<samp>athlonxp</samp>’</dt>
|
|---|
| 737 | <dt>‘<samp>k8</samp>’</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
|
|---|
| 745 | results. 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
|
|---|
| 749 | global OpenCL context are set via <samp>-opencl_options</samp>. See the
|
|---|
| 750 | "OpenCL Options" section in the ffmpeg-utils manual for the complete list of
|
|---|
| 751 | supported options. Amongst others, these options include the ability to select
|
|---|
| 752 | a specific platform and device to run the OpenCL code on. By default, FFmpeg
|
|---|
| 753 | will run on the first device of the first platform. While the options for the
|
|---|
| 754 | global OpenCL context provide flexibility to the user in selecting the OpenCL
|
|---|
| 755 | device of their choice, most users would probably want to select the fastest
|
|---|
| 756 | OpenCL device for their system.
|
|---|
| 757 | </p>
|
|---|
| 758 | <p>This option assists the selection of the most efficient configuration by
|
|---|
| 759 | identifying the appropriate device for the user’s system. The built-in
|
|---|
| 760 | benchmark is run on all the OpenCL devices and the performance is measured for
|
|---|
| 761 | each device. The devices in the results list are sorted based on their
|
|---|
| 762 | performance with the fastest device listed first. The user can subsequently
|
|---|
| 763 | invoke <code>ffmpeg</code> using the device deemed most appropriate via
|
|---|
| 764 | <samp>-opencl_options</samp> to obtain the best performance for the OpenCL
|
|---|
| 765 | accelerated 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
|
|---|
| 774 | i.e. fastest device in the list.
|
|---|
| 775 | Select 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
|
|---|
| 783 | FFmpeg 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
|
|---|
| 786 | separated by ’:’. See the “OpenCL Options” section in the
|
|---|
| 787 | ffmpeg-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
|
|---|
| 795 | libavcodec 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
|
|---|
| 800 | are listed under AVFormatContext options for containers/devices and under
|
|---|
| 801 | AVCodecContext 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
|
|---|
| 805 | options 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
|
|---|
| 810 | an MP3 file, use the <samp>id3v2_version</samp> private option of the MP3
|
|---|
| 811 | muxer:
|
|---|
| 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
|
|---|
| 817 | should be attached to them.
|
|---|
| 818 | </p>
|
|---|
| 819 | <p>Note: the <samp>-nooption</samp> syntax cannot be used for boolean
|
|---|
| 820 | AVOptions, use <samp>-option 0</samp>/<samp>-option 1</samp>.
|
|---|
| 821 | </p>
|
|---|
| 822 | <p>Note: the old undocumented way of specifying per-stream AVOptions by
|
|---|
| 823 | prepending v/a/s to the options name is now obsolete and will be
|
|---|
| 824 | removed 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
|
|---|
| 832 | read 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>
|
|---|
| 837 | directives within the various <code><Feed></code> sections. Since
|
|---|
| 838 | <code>ffserver</code> will not launch any <code>ffmpeg</code> instances, you
|
|---|
| 839 | will 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
|
|---|
| 844 | log messages to stdout. When specified, the <samp>CustomLog</samp> option
|
|---|
| 845 | is 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
|
|---|
| 853 | options and settings for each stream and feed.
|
|---|
| 854 | </p>
|
|---|
| 855 | <p>The configuration file consists of global options and dedicated
|
|---|
| 856 | sections, which must be introduced by "<<var>SECTION_NAME</var>
|
|---|
| 857 | <var>ARGS</var>>" on a separate line and must be terminated by a line in
|
|---|
| 858 | the form "</<var>SECTION_NAME</var>>". <var>ARGS</var> is optional.
|
|---|
| 859 | </p>
|
|---|
| 860 | <p>Currently the following sections are recognized: ‘<samp>Feed</samp>’,
|
|---|
| 861 | ‘<samp>Stream</samp>’, ‘<samp>Redirect</samp>’.
|
|---|
| 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
|
|---|
| 870 | to 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 <address>
|
|---|
| 877 | ACL DENY <address>
|
|---|
| 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 <first_address> <last_address>
|
|---|
| 884 | ACL DENY <first_address> <last_address>
|
|---|
| 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
|
|---|
| 889 | stream basis. The first match defines the action. If there are no matches,
|
|---|
| 890 | then the default is the inverse of the last ACL statement.
|
|---|
| 891 | </p>
|
|---|
| 892 | <p>Thus ’ACL allow localhost’ only allows access from localhost.
|
|---|
| 893 | ’ACL deny 1.0.0.0 1.255.255.255’ would deny the whole of network 1 and
|
|---|
| 894 | allow 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
|
|---|
| 909 | it 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
|
|---|
| 918 | have several network interfaces.
|
|---|
| 919 | </p>
|
|---|
| 920 | <p><var>BindAddress</var> is the equivalent of <var>HTTPBindAddress</var> and is
|
|---|
| 921 | deprecated.
|
|---|
| 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
|
|---|
| 926 | has to be defined <em>before</em> the <samp>MaxClients</samp> parameter,
|
|---|
| 927 | since 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
|
|---|
| 935 | to 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
|
|---|
| 942 | when 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). ’-’ is the
|
|---|
| 949 | standard 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
|
|---|
| 954 | ignored, 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
|
|---|
| 960 | deprecated.
|
|---|
| 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.
|
|---|
| 966 | Each stream may overwrite this setting for its own. Default is <var>UseDefaults</var>.
|
|---|
| 967 | The 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
|
|---|
| 978 | may be encoded simultaneously with several codecs at several
|
|---|
| 979 | resolutions.
|
|---|
| 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"><Feed FEED_FILENAME>
|
|---|
| 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
|
|---|
| 999 | it 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
|
|---|
| 1005 | file 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
|
|---|
| 1010 | postfixes <code>K</code> (2^10), <code>M</code> (2^20), and <code>G</code> (2^30) are
|
|---|
| 1011 | recognized.
|
|---|
| 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
|
|---|
| 1021 | it is replaced by a path with the same dirname of the <code>ffserver</code>
|
|---|
| 1022 | instance, followed by the remaining argument and terminated with a
|
|---|
| 1023 | path corresponding to the feed.
|
|---|
| 1024 | </p>
|
|---|
| 1025 | <p>When the launched process exits, <code>ffserver</code> will launch
|
|---|
| 1026 | another program instance.
|
|---|
| 1027 | </p>
|
|---|
| 1028 | <p>In case you need a more complex <code>ffmpeg</code> configuration,
|
|---|
| 1029 | e.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
|
|---|
| 1033 | specified.
|
|---|
| 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
|
|---|
| 1038 | the 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
|
|---|
| 1046 | identified by a single name.
|
|---|
| 1047 | </p>
|
|---|
| 1048 | <p>The stream is sent when answering a request containing the stream
|
|---|
| 1049 | name.
|
|---|
| 1050 | </p>
|
|---|
| 1051 | <p>A stream section must be introduced by the line:
|
|---|
| 1052 | </p><div class="example">
|
|---|
| 1053 | <pre class="example"><Stream STREAM_NAME>
|
|---|
| 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
|
|---|
| 1061 | used to set the encoding parameters, and are mapped to libavcodec
|
|---|
| 1062 | encoding options. Not all encoding options are supported, in
|
|---|
| 1063 | particular it is not possible to set encoder private options. In order
|
|---|
| 1064 | to override the encoding options specified by <code>ffserver</code>, you
|
|---|
| 1065 | can use the <code>ffmpeg</code> <samp>override_ffserver</samp> commandline
|
|---|
| 1066 | option.
|
|---|
| 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
|
|---|
| 1073 | feed defined in a <code>Feed</code> section.
|
|---|
| 1074 | </p>
|
|---|
| 1075 | <p>When this option is set, encoding options are used to setup the
|
|---|
| 1076 | encoding 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
|
|---|
| 1083 | file 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 | ‘<samp>status</samp>’, 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
|
|---|
| 1099 | most players will buffer 5-10 seconds of video, and also you need to allow
|
|---|
| 1100 | for 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
|
|---|
| 1112 | of 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
|
|---|
| 1129 | for 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
|
|---|
| 1137 | deprecated 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.
|
|---|
| 1147 | Default 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
|
|---|
| 1169 | lower this frequency to 22050 or 11025. The supported frequencies
|
|---|
| 1170 | depend 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.
|
|---|
| 1175 | Private 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
|
|---|
| 1194 | specifies the <samp>minrate</samp> and <samp>maxrate</samp> encoding options
|
|---|
| 1195 | expressed 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
|
|---|
| 1225 | in 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
|
|---|
| 1236 | frames. 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
|
|---|
| 1255 | scale) 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.
|
|---|
| 1274 | Private 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
|
|---|
| 1288 | statistics about the <code>ffserver</code> operations.
|
|---|
| 1289 | </p>
|
|---|
| 1290 | <p>It must be specified setting the option <samp>Format</samp> to
|
|---|
| 1291 | ‘<samp>status</samp>’.
|
|---|
| 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
|
|---|
| 1297 | another page.
|
|---|
| 1298 | </p>
|
|---|
| 1299 | <p>A redirect section must be introduced by the line:
|
|---|
| 1300 | </p><div class="example">
|
|---|
| 1301 | <pre class="example"><Redirect NAME>
|
|---|
| 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
|
|---|
| 1307 | URL.
|
|---|
| 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"><Stream test.mjpg>
|
|---|
| 1316 | Feed feed1.ffm
|
|---|
| 1317 | Format mpjpeg
|
|---|
| 1318 | VideoFrameRate 2
|
|---|
| 1319 | VideoIntraOnly
|
|---|
| 1320 | NoAudio
|
|---|
| 1321 | Strict -1
|
|---|
| 1322 | </Stream>
|
|---|
| 1323 | </pre></div>
|
|---|
| 1324 |
|
|---|
| 1325 | </li><li> Single JPEG
|
|---|
| 1326 | <div class="example">
|
|---|
| 1327 | <pre class="example"><Stream test.jpg>
|
|---|
| 1328 | Feed feed1.ffm
|
|---|
| 1329 | Format jpeg
|
|---|
| 1330 | VideoFrameRate 2
|
|---|
| 1331 | VideoIntraOnly
|
|---|
| 1332 | VideoSize 352x240
|
|---|
| 1333 | NoAudio
|
|---|
| 1334 | Strict -1
|
|---|
| 1335 | </Stream>
|
|---|
| 1336 | </pre></div>
|
|---|
| 1337 |
|
|---|
| 1338 | </li><li> Flash
|
|---|
| 1339 | <div class="example">
|
|---|
| 1340 | <pre class="example"><Stream test.swf>
|
|---|
| 1341 | Feed feed1.ffm
|
|---|
| 1342 | Format swf
|
|---|
| 1343 | VideoFrameRate 2
|
|---|
| 1344 | VideoIntraOnly
|
|---|
| 1345 | NoAudio
|
|---|
| 1346 | </Stream>
|
|---|
| 1347 | </pre></div>
|
|---|
| 1348 |
|
|---|
| 1349 | </li><li> ASF compatible
|
|---|
| 1350 | <div class="example">
|
|---|
| 1351 | <pre class="example"><Stream test.asf>
|
|---|
| 1352 | Feed feed1.ffm
|
|---|
| 1353 | Format asf
|
|---|
| 1354 | VideoFrameRate 15
|
|---|
| 1355 | VideoSize 352x240
|
|---|
| 1356 | VideoBitRate 256
|
|---|
| 1357 | VideoBufferSize 40
|
|---|
| 1358 | VideoGopSize 30
|
|---|
| 1359 | AudioBitRate 64
|
|---|
| 1360 | StartSendOnKey
|
|---|
| 1361 | </Stream>
|
|---|
| 1362 | </pre></div>
|
|---|
| 1363 |
|
|---|
| 1364 | </li><li> MP3 audio
|
|---|
| 1365 | <div class="example">
|
|---|
| 1366 | <pre class="example"><Stream test.mp3>
|
|---|
| 1367 | Feed feed1.ffm
|
|---|
| 1368 | Format mp2
|
|---|
| 1369 | AudioCodec mp3
|
|---|
| 1370 | AudioBitRate 64
|
|---|
| 1371 | AudioChannels 1
|
|---|
| 1372 | AudioSampleRate 44100
|
|---|
| 1373 | NoVideo
|
|---|
| 1374 | </Stream>
|
|---|
| 1375 | </pre></div>
|
|---|
| 1376 |
|
|---|
| 1377 | </li><li> Ogg Vorbis audio
|
|---|
| 1378 | <div class="example">
|
|---|
| 1379 | <pre class="example"><Stream test.ogg>
|
|---|
| 1380 | Feed feed1.ffm
|
|---|
| 1381 | Metadata title "Stream title"
|
|---|
| 1382 | AudioBitRate 64
|
|---|
| 1383 | AudioChannels 2
|
|---|
| 1384 | AudioSampleRate 44100
|
|---|
| 1385 | NoVideo
|
|---|
| 1386 | </Stream>
|
|---|
| 1387 | </pre></div>
|
|---|
| 1388 |
|
|---|
| 1389 | </li><li> Real with audio only at 32 kbits
|
|---|
| 1390 | <div class="example">
|
|---|
| 1391 | <pre class="example"><Stream test.ra>
|
|---|
| 1392 | Feed feed1.ffm
|
|---|
| 1393 | Format rm
|
|---|
| 1394 | AudioBitRate 32
|
|---|
| 1395 | NoVideo
|
|---|
| 1396 | </Stream>
|
|---|
| 1397 | </pre></div>
|
|---|
| 1398 |
|
|---|
| 1399 | </li><li> Real with audio and video at 64 kbits
|
|---|
| 1400 | <div class="example">
|
|---|
| 1401 | <pre class="example"><Stream test.rm>
|
|---|
| 1402 | Feed feed1.ffm
|
|---|
| 1403 | Format rm
|
|---|
| 1404 | AudioBitRate 32
|
|---|
| 1405 | VideoBitRate 128
|
|---|
| 1406 | VideoFrameRate 25
|
|---|
| 1407 | VideoGopSize 25
|
|---|
| 1408 | </Stream>
|
|---|
| 1409 | </pre></div>
|
|---|
| 1410 |
|
|---|
| 1411 | </li><li> For stream coming from a file: you only need to set the input filename
|
|---|
| 1412 | and optionally a new format.
|
|---|
| 1413 |
|
|---|
| 1414 | <div class="example">
|
|---|
| 1415 | <pre class="example"><Stream file.rm>
|
|---|
| 1416 | File "/usr/local/httpd/htdocs/tlive.rm"
|
|---|
| 1417 | NoAudio
|
|---|
| 1418 | </Stream>
|
|---|
| 1419 | </pre></div>
|
|---|
| 1420 |
|
|---|
| 1421 | <div class="example">
|
|---|
| 1422 | <pre class="example"><Stream file.asf>
|
|---|
| 1423 | File "/usr/local/httpd/htdocs/test.asf"
|
|---|
| 1424 | NoAudio
|
|---|
| 1425 | Metadata author "Me"
|
|---|
| 1426 | Metadata copyright "Super MegaCorp"
|
|---|
| 1427 | Metadata title "Test stream from disk"
|
|---|
| 1428 | Metadata comment "Test comment"
|
|---|
| 1429 | </Stream>
|
|---|
| 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
|
|---|
| 1459 | online 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>
|
|---|