ffserver.texi 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923
  1. \input texinfo @c -*- texinfo -*-
  2. @documentencoding UTF-8
  3. @settitle ffserver Documentation
  4. @titlepage
  5. @center @titlefont{ffserver Documentation}
  6. @end titlepage
  7. @top
  8. @contents
  9. @chapter Synopsis
  10. ffserver [@var{options}]
  11. @chapter Description
  12. @c man begin DESCRIPTION
  13. @command{ffserver} is a streaming server for both audio and video.
  14. It supports several live feeds, streaming from files and time shifting
  15. on live feeds. You can seek to positions in the past on each live
  16. feed, provided you specify a big enough feed storage.
  17. @command{ffserver} is configured through a configuration file, which
  18. is read at startup. If not explicitly specified, it will read from
  19. @file{/etc/ffserver.conf}.
  20. @command{ffserver} receives prerecorded files or FFM streams from some
  21. @command{ffmpeg} instance as input, then streams them over
  22. RTP/RTSP/HTTP.
  23. An @command{ffserver} instance will listen on some port as specified
  24. in the configuration file. You can launch one or more instances of
  25. @command{ffmpeg} and send one or more FFM streams to the port where
  26. ffserver is expecting to receive them. Alternately, you can make
  27. @command{ffserver} launch such @command{ffmpeg} instances at startup.
  28. Input streams are called feeds, and each one is specified by a
  29. @code{<Feed>} section in the configuration file.
  30. For each feed you can have different output streams in various
  31. formats, each one specified by a @code{<Stream>} section in the
  32. configuration file.
  33. @chapter Detailed description
  34. @command{ffserver} works by forwarding streams encoded by
  35. @command{ffmpeg}, or pre-recorded streams which are read from disk.
  36. Precisely, @command{ffserver} acts as an HTTP server, accepting POST
  37. requests from @command{ffmpeg} to acquire the stream to publish, and
  38. serving RTSP clients or HTTP clients GET requests with the stream
  39. media content.
  40. A feed is an @ref{FFM} stream created by @command{ffmpeg}, and sent to
  41. a port where @command{ffserver} is listening.
  42. Each feed is identified by a unique name, corresponding to the name
  43. of the resource published on @command{ffserver}, and is configured by
  44. a dedicated @code{Feed} section in the configuration file.
  45. The feed publish URL is given by:
  46. @example
  47. http://@var{ffserver_ip_address}:@var{http_port}/@var{feed_name}
  48. @end example
  49. where @var{ffserver_ip_address} is the IP address of the machine where
  50. @command{ffserver} is installed, @var{http_port} is the port number of
  51. the HTTP server (configured through the @option{HTTPPort} option), and
  52. @var{feed_name} is the name of the corresponding feed defined in the
  53. configuration file.
  54. Each feed is associated to a file which is stored on disk. This stored
  55. file is used to send pre-recorded data to a player as fast as
  56. possible when new content is added in real-time to the stream.
  57. A "live-stream" or "stream" is a resource published by
  58. @command{ffserver}, and made accessible through the HTTP protocol to
  59. clients.
  60. A stream can be connected to a feed, or to a file. In the first case,
  61. the published stream is forwarded from the corresponding feed
  62. generated by a running instance of @command{ffmpeg}, in the second
  63. case the stream is read from a pre-recorded file.
  64. Each stream is identified by a unique name, corresponding to the name
  65. of the resource served by @command{ffserver}, and is configured by
  66. a dedicated @code{Stream} section in the configuration file.
  67. The stream access HTTP URL is given by:
  68. @example
  69. http://@var{ffserver_ip_address}:@var{http_port}/@var{stream_name}[@var{options}]
  70. @end example
  71. The stream access RTSP URL is given by:
  72. @example
  73. http://@var{ffserver_ip_address}:@var{rtsp_port}/@var{stream_name}[@var{options}]
  74. @end example
  75. @var{stream_name} is the name of the corresponding stream defined in
  76. the configuration file. @var{options} is a list of options specified
  77. after the URL which affects how the stream is served by
  78. @command{ffserver}. @var{http_port} and @var{rtsp_port} are the HTTP
  79. and RTSP ports configured with the options @var{HTTPPort} and
  80. @var{RTSPPort} respectively.
  81. In case the stream is associated to a feed, the encoding parameters
  82. must be configured in the stream configuration. They are sent to
  83. @command{ffmpeg} when setting up the encoding. This allows
  84. @command{ffserver} to define the encoding parameters used by
  85. the @command{ffmpeg} encoders.
  86. The @command{ffmpeg} @option{override_ffserver} commandline option
  87. allows one to override the encoding parameters set by the server.
  88. Multiple streams can be connected to the same feed.
  89. For example, you can have a situation described by the following
  90. graph:
  91. @verbatim
  92. _________ __________
  93. | | | |
  94. ffmpeg 1 -----| feed 1 |-----| stream 1 |
  95. \ |_________|\ |__________|
  96. \ \
  97. \ \ __________
  98. \ \ | |
  99. \ \| stream 2 |
  100. \ |__________|
  101. \
  102. \ _________ __________
  103. \ | | | |
  104. \| feed 2 |-----| stream 3 |
  105. |_________| |__________|
  106. _________ __________
  107. | | | |
  108. ffmpeg 2 -----| feed 3 |-----| stream 4 |
  109. |_________| |__________|
  110. _________ __________
  111. | | | |
  112. | file 1 |-----| stream 5 |
  113. |_________| |__________|
  114. @end verbatim
  115. @anchor{FFM}
  116. @section FFM, FFM2 formats
  117. FFM and FFM2 are formats used by ffserver. They allow storing a wide variety of
  118. video and audio streams and encoding options, and can store a moving time segment
  119. of an infinite movie or a whole movie.
  120. FFM is version specific, and there is limited compatibility of FFM files
  121. generated by one version of ffmpeg/ffserver and another version of
  122. ffmpeg/ffserver. It may work but it is not guaranteed to work.
  123. FFM2 is extensible while maintaining compatibility and should work between
  124. differing versions of tools. FFM2 is the default.
  125. @section Status stream
  126. @command{ffserver} supports an HTTP interface which exposes the
  127. current status of the server.
  128. Simply point your browser to the address of the special status stream
  129. specified in the configuration file.
  130. For example if you have:
  131. @example
  132. <Stream status.html>
  133. Format status
  134. # Only allow local people to get the status
  135. ACL allow localhost
  136. ACL allow 192.168.0.0 192.168.255.255
  137. </Stream>
  138. @end example
  139. then the server will post a page with the status information when
  140. the special stream @file{status.html} is requested.
  141. @section How do I make it work?
  142. As a simple test, just run the following two command lines where INPUTFILE
  143. is some file which you can decode with ffmpeg:
  144. @example
  145. ffserver -f doc/ffserver.conf &
  146. ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm
  147. @end example
  148. At this point you should be able to go to your Windows machine and fire up
  149. Windows Media Player (WMP). Go to Open URL and enter
  150. @example
  151. http://<linuxbox>:8090/test.asf
  152. @end example
  153. You should (after a short delay) see video and hear audio.
  154. WARNING: trying to stream test1.mpg doesn't work with WMP as it tries to
  155. transfer the entire file before starting to play.
  156. The same is true of AVI files.
  157. You should edit the @file{ffserver.conf} file to suit your needs (in
  158. terms of frame rates etc). Then install @command{ffserver} and
  159. @command{ffmpeg}, write a script to start them up, and off you go.
  160. @section What else can it do?
  161. You can replay video from .ffm files that was recorded earlier.
  162. However, there are a number of caveats, including the fact that the
  163. ffserver parameters must match the original parameters used to record the
  164. file. If they do not, then ffserver deletes the file before recording into it.
  165. (Now that I write this, it seems broken).
  166. You can fiddle with many of the codec choices and encoding parameters, and
  167. there are a bunch more parameters that you cannot control. Post a message
  168. to the mailing list if there are some 'must have' parameters. Look in
  169. ffserver.conf for a list of the currently available controls.
  170. It will automatically generate the ASX or RAM files that are often used
  171. in browsers. These files are actually redirections to the underlying ASF
  172. or RM file. The reason for this is that the browser often fetches the
  173. entire file before starting up the external viewer. The redirection files
  174. are very small and can be transferred quickly. [The stream itself is
  175. often 'infinite' and thus the browser tries to download it and never
  176. finishes.]
  177. @section Tips
  178. * When you connect to a live stream, most players (WMP, RA, etc) want to
  179. buffer a certain number of seconds of material so that they can display the
  180. signal continuously. However, ffserver (by default) starts sending data
  181. in realtime. This means that there is a pause of a few seconds while the
  182. buffering is being done by the player. The good news is that this can be
  183. cured by adding a '?buffer=5' to the end of the URL. This means that the
  184. stream should start 5 seconds in the past -- and so the first 5 seconds
  185. of the stream are sent as fast as the network will allow. It will then
  186. slow down to real time. This noticeably improves the startup experience.
  187. You can also add a 'Preroll 15' statement into the ffserver.conf that will
  188. add the 15 second prebuffering on all requests that do not otherwise
  189. specify a time. In addition, ffserver will skip frames until a key_frame
  190. is found. This further reduces the startup delay by not transferring data
  191. that will be discarded.
  192. @section Why does the ?buffer / Preroll stop working after a time?
  193. It turns out that (on my machine at least) the number of frames successfully
  194. grabbed is marginally less than the number that ought to be grabbed. This
  195. means that the timestamp in the encoded data stream gets behind realtime.
  196. This means that if you say 'Preroll 10', then when the stream gets 10
  197. or more seconds behind, there is no Preroll left.
  198. Fixing this requires a change in the internals of how timestamps are
  199. handled.
  200. @section Does the @code{?date=} stuff work.
  201. Yes (subject to the limitation outlined above). Also note that whenever you
  202. start ffserver, it deletes the ffm file (if any parameters have changed),
  203. thus wiping out what you had recorded before.
  204. The format of the @code{?date=xxxxxx} is fairly flexible. You should use one
  205. of the following formats (the 'T' is literal):
  206. @example
  207. * YYYY-MM-DDTHH:MM:SS (localtime)
  208. * YYYY-MM-DDTHH:MM:SSZ (UTC)
  209. @end example
  210. You can omit the YYYY-MM-DD, and then it refers to the current day. However
  211. note that @samp{?date=16:00:00} refers to 16:00 on the current day -- this
  212. may be in the future and so is unlikely to be useful.
  213. You use this by adding the ?date= to the end of the URL for the stream.
  214. For example: @samp{http://localhost:8080/test.asf?date=2002-07-26T23:05:00}.
  215. @c man end
  216. @chapter Options
  217. @c man begin OPTIONS
  218. @include fftools-common-opts.texi
  219. @section Main options
  220. @table @option
  221. @item -f @var{configfile}
  222. Read configuration file @file{configfile}. If not specified it will
  223. read by default from @file{/etc/ffserver.conf}.
  224. @item -n
  225. Enable no-launch mode. This option disables all the @code{Launch}
  226. directives within the various @code{<Feed>} sections. Since
  227. @command{ffserver} will not launch any @command{ffmpeg} instances, you
  228. will have to launch them manually.
  229. @item -d
  230. Enable debug mode. This option increases log verbosity, and directs
  231. log messages to stdout. When specified, the @option{CustomLog} option
  232. is ignored.
  233. @end table
  234. @chapter Configuration file syntax
  235. @command{ffserver} reads a configuration file containing global
  236. options and settings for each stream and feed.
  237. The configuration file consists of global options and dedicated
  238. sections, which must be introduced by "<@var{SECTION_NAME}
  239. @var{ARGS}>" on a separate line and must be terminated by a line in
  240. the form "</@var{SECTION_NAME}>". @var{ARGS} is optional.
  241. Currently the following sections are recognized: @samp{Feed},
  242. @samp{Stream}, @samp{Redirect}.
  243. A line starting with @code{#} is ignored and treated as a comment.
  244. Name of options and sections are case-insensitive.
  245. @section ACL syntax
  246. An ACL (Access Control List) specifies the address which are allowed
  247. to access a given stream, or to write a given feed.
  248. It accepts the folling forms
  249. @itemize
  250. @item
  251. Allow/deny access to @var{address}.
  252. @example
  253. ACL ALLOW <address>
  254. ACL DENY <address>
  255. @end example
  256. @item
  257. Allow/deny access to ranges of addresses from @var{first_address} to
  258. @var{last_address}.
  259. @example
  260. ACL ALLOW <first_address> <last_address>
  261. ACL DENY <first_address> <last_address>
  262. @end example
  263. @end itemize
  264. You can repeat the ACL allow/deny as often as you like. It is on a per
  265. stream basis. The first match defines the action. If there are no matches,
  266. then the default is the inverse of the last ACL statement.
  267. Thus 'ACL allow localhost' only allows access from localhost.
  268. 'ACL deny 1.0.0.0 1.255.255.255' would deny the whole of network 1 and
  269. allow everybody else.
  270. @section Global options
  271. @table @option
  272. @item HTTPPort @var{port_number}
  273. @item Port @var{port_number}
  274. @item RTSPPort @var{port_number}
  275. @var{HTTPPort} sets the HTTP server listening TCP port number,
  276. @var{RTSPPort} sets the RTSP server listening TCP port number.
  277. @var{Port} is the equivalent of @var{HTTPPort} and is deprecated.
  278. You must select a different port from your standard HTTP web server if
  279. it is running on the same computer.
  280. If not specified, no corresponding server will be created.
  281. @item HTTPBindAddress @var{ip_address}
  282. @item BindAddress @var{ip_address}
  283. @item RTSPBindAddress @var{ip_address}
  284. Set address on which the HTTP/RTSP server is bound. Only useful if you
  285. have several network interfaces.
  286. @var{BindAddress} is the equivalent of @var{HTTPBindAddress} and is
  287. deprecated.
  288. @item MaxHTTPConnections @var{n}
  289. Set number of simultaneous HTTP connections that can be handled. It
  290. has to be defined @emph{before} the @option{MaxClients} parameter,
  291. since it defines the @option{MaxClients} maximum limit.
  292. Default value is 2000.
  293. @item MaxClients @var{n}
  294. Set number of simultaneous requests that can be handled. Since
  295. @command{ffserver} is very fast, it is more likely that you will want
  296. to leave this high and use @option{MaxBandwidth}.
  297. Default value is 5.
  298. @item MaxBandwidth @var{kbps}
  299. Set the maximum amount of kbit/sec that you are prepared to consume
  300. when streaming to clients.
  301. Default value is 1000.
  302. @item CustomLog @var{filename}
  303. Set access log file (uses standard Apache log file format). '-' is the
  304. standard output.
  305. If not specified @command{ffserver} will produce no log.
  306. In case the commandline option @option{-d} is specified this option is
  307. ignored, and the log is written to standard output.
  308. @item NoDaemon
  309. Set no-daemon mode. This option is currently ignored since now
  310. @command{ffserver} will always work in no-daemon mode, and is
  311. deprecated.
  312. @item UseDefaults
  313. @item NoDefaults
  314. Control whether default codec options are used for the all streams or not.
  315. Each stream may overwrite this setting for its own. Default is @var{UseDefaults}.
  316. The lastest occurrence overrides previous if multiple definitions.
  317. @end table
  318. @section Feed section
  319. A Feed section defines a feed provided to @command{ffserver}.
  320. Each live feed contains one video and/or audio sequence coming from an
  321. @command{ffmpeg} encoder or another @command{ffserver}. This sequence
  322. may be encoded simultaneously with several codecs at several
  323. resolutions.
  324. A feed instance specification is introduced by a line in the form:
  325. @example
  326. <Feed FEED_FILENAME>
  327. @end example
  328. where @var{FEED_FILENAME} specifies the unique name of the FFM stream.
  329. The following options are recognized within a Feed section.
  330. @table @option
  331. @item File @var{filename}
  332. @item ReadOnlyFile @var{filename}
  333. Set the path where the feed file is stored on disk.
  334. If not specified, the @file{/tmp/FEED.ffm} is assumed, where
  335. @var{FEED} is the feed name.
  336. If @option{ReadOnlyFile} is used the file is marked as read-only and
  337. it will not be deleted or updated.
  338. @item Truncate
  339. Truncate the feed file, rather than appending to it. By default
  340. @command{ffserver} will append data to the file, until the maximum
  341. file size value is reached (see @option{FileMaxSize} option).
  342. @item FileMaxSize @var{size}
  343. Set maximum size of the feed file in bytes. 0 means unlimited. The
  344. postfixes @code{K} (2^10), @code{M} (2^20), and @code{G} (2^30) are
  345. recognized.
  346. Default value is 5M.
  347. @item Launch @var{args}
  348. Launch an @command{ffmpeg} command when creating @command{ffserver}.
  349. @var{args} must be a sequence of arguments to be provided to an
  350. @command{ffmpeg} instance. The first provided argument is ignored, and
  351. it is replaced by a path with the same dirname of the @command{ffserver}
  352. instance, followed by the remaining argument and terminated with a
  353. path corresponding to the feed.
  354. When the launched process exits, @command{ffserver} will launch
  355. another program instance.
  356. In case you need a more complex @command{ffmpeg} configuration,
  357. e.g. if you need to generate multiple FFM feeds with a single
  358. @command{ffmpeg} instance, you should launch @command{ffmpeg} by hand.
  359. This option is ignored in case the commandline option @option{-n} is
  360. specified.
  361. @item ACL @var{spec}
  362. Specify the list of IP address which are allowed or denied to write
  363. the feed. Multiple ACL options can be specified.
  364. @end table
  365. @section Stream section
  366. A Stream section defines a stream provided by @command{ffserver}, and
  367. identified by a single name.
  368. The stream is sent when answering a request containing the stream
  369. name.
  370. A stream section must be introduced by the line:
  371. @example
  372. <Stream STREAM_NAME>
  373. @end example
  374. where @var{STREAM_NAME} specifies the unique name of the stream.
  375. The following options are recognized within a Stream section.
  376. Encoding options are marked with the @emph{encoding} tag, and they are
  377. used to set the encoding parameters, and are mapped to libavcodec
  378. encoding options. Not all encoding options are supported, in
  379. particular it is not possible to set encoder private options. In order
  380. to override the encoding options specified by @command{ffserver}, you
  381. can use the @command{ffmpeg} @option{override_ffserver} commandline
  382. option.
  383. Only one of the @option{Feed} and @option{File} options should be set.
  384. @table @option
  385. @item Feed @var{feed_name}
  386. Set the input feed. @var{feed_name} must correspond to an existing
  387. feed defined in a @code{Feed} section.
  388. When this option is set, encoding options are used to setup the
  389. encoding operated by the remote @command{ffmpeg} process.
  390. @item File @var{filename}
  391. Set the filename of the pre-recorded input file to stream.
  392. When this option is set, encoding options are ignored and the input
  393. file content is re-streamed as is.
  394. @item Format @var{format_name}
  395. Set the format of the output stream.
  396. Must be the name of a format recognized by FFmpeg. If set to
  397. @samp{status}, it is treated as a status stream.
  398. @item InputFormat @var{format_name}
  399. Set input format. If not specified, it is automatically guessed.
  400. @item Preroll @var{n}
  401. Set this to the number of seconds backwards in time to start. Note that
  402. most players will buffer 5-10 seconds of video, and also you need to allow
  403. for a keyframe to appear in the data stream.
  404. Default value is 0.
  405. @item StartSendOnKey
  406. Do not send stream until it gets the first key frame. By default
  407. @command{ffserver} will send data immediately.
  408. @item MaxTime @var{n}
  409. Set the number of seconds to run. This value set the maximum duration
  410. of the stream a client will be able to receive.
  411. A value of 0 means that no limit is set on the stream duration.
  412. @item ACL @var{spec}
  413. Set ACL for the stream.
  414. @item DynamicACL @var{spec}
  415. @item RTSPOption @var{option}
  416. @item MulticastAddress @var{address}
  417. @item MulticastPort @var{port}
  418. @item MulticastTTL @var{integer}
  419. @item NoLoop
  420. @item FaviconURL @var{url}
  421. Set favicon (favourite icon) for the server status page. It is ignored
  422. for regular streams.
  423. @item Author @var{value}
  424. @item Comment @var{value}
  425. @item Copyright @var{value}
  426. @item Title @var{value}
  427. Set metadata corresponding to the option. All these options are
  428. deprecated in favor of @option{Metadata}.
  429. @item Metadata @var{key} @var{value}
  430. Set metadata value on the output stream.
  431. @item UseDefaults
  432. @item NoDefaults
  433. Control whether default codec options are used for the stream or not.
  434. Default is @var{UseDefaults} unless disabled globally.
  435. @item NoAudio
  436. @item NoVideo
  437. Suppress audio/video.
  438. @item AudioCodec @var{codec_name} (@emph{encoding,audio})
  439. Set audio codec.
  440. @item AudioBitRate @var{rate} (@emph{encoding,audio})
  441. Set bitrate for the audio stream in kbits per second.
  442. @item AudioChannels @var{n} (@emph{encoding,audio})
  443. Set number of audio channels.
  444. @item AudioSampleRate @var{n} (@emph{encoding,audio})
  445. Set sampling frequency for audio. When using low bitrates, you should
  446. lower this frequency to 22050 or 11025. The supported frequencies
  447. depend on the selected audio codec.
  448. @item AVOptionAudio [@var{codec}:]@var{option} @var{value} (@emph{encoding,audio})
  449. Set generic or private option for audio stream.
  450. Private option must be prefixed with codec name or codec must be defined before.
  451. @item AVPresetAudio @var{preset} (@emph{encoding,audio})
  452. Set preset for audio stream.
  453. @item VideoCodec @var{codec_name} (@emph{encoding,video})
  454. Set video codec.
  455. @item VideoBitRate @var{n} (@emph{encoding,video})
  456. Set bitrate for the video stream in kbits per second.
  457. @item VideoBitRateRange @var{range} (@emph{encoding,video})
  458. Set video bitrate range.
  459. A range must be specified in the form @var{minrate}-@var{maxrate}, and
  460. specifies the @option{minrate} and @option{maxrate} encoding options
  461. expressed in kbits per second.
  462. @item VideoBitRateRangeTolerance @var{n} (@emph{encoding,video})
  463. Set video bitrate tolerance in kbits per second.
  464. @item PixelFormat @var{pixel_format} (@emph{encoding,video})
  465. Set video pixel format.
  466. @item Debug @var{integer} (@emph{encoding,video})
  467. Set video @option{debug} encoding option.
  468. @item Strict @var{integer} (@emph{encoding,video})
  469. Set video @option{strict} encoding option.
  470. @item VideoBufferSize @var{n} (@emph{encoding,video})
  471. Set ratecontrol buffer size, expressed in KB.
  472. @item VideoFrameRate @var{n} (@emph{encoding,video})
  473. Set number of video frames per second.
  474. @item VideoSize (@emph{encoding,video})
  475. Set size of the video frame, must be an abbreviation or in the form
  476. @var{W}x@var{H}. See @ref{video size syntax,,the Video size section
  477. in the ffmpeg-utils(1) manual,ffmpeg-utils}.
  478. Default value is @code{160x128}.
  479. @item VideoIntraOnly (@emph{encoding,video})
  480. Transmit only intra frames (useful for low bitrates, but kills frame rate).
  481. @item VideoGopSize @var{n} (@emph{encoding,video})
  482. If non-intra only, an intra frame is transmitted every VideoGopSize
  483. frames. Video synchronization can only begin at an intra frame.
  484. @item VideoTag @var{tag} (@emph{encoding,video})
  485. Set video tag.
  486. @item VideoHighQuality (@emph{encoding,video})
  487. @item Video4MotionVector (@emph{encoding,video})
  488. @item BitExact (@emph{encoding,video})
  489. Set bitexact encoding flag.
  490. @item IdctSimple (@emph{encoding,video})
  491. Set simple IDCT algorithm.
  492. @item Qscale @var{n} (@emph{encoding,video})
  493. Enable constant quality encoding, and set video qscale (quantization
  494. scale) value, expressed in @var{n} QP units.
  495. @item VideoQMin @var{n} (@emph{encoding,video})
  496. @item VideoQMax @var{n} (@emph{encoding,video})
  497. Set video qmin/qmax.
  498. @item VideoQDiff @var{integer} (@emph{encoding,video})
  499. Set video @option{qdiff} encoding option.
  500. @item LumiMask @var{float} (@emph{encoding,video})
  501. @item DarkMask @var{float} (@emph{encoding,video})
  502. Set @option{lumi_mask}/@option{dark_mask} encoding options.
  503. @item AVOptionVideo [@var{codec}:]@var{option} @var{value} (@emph{encoding,video})
  504. Set generic or private option for video stream.
  505. Private option must be prefixed with codec name or codec must be defined before.
  506. @item AVPresetVideo @var{preset} (@emph{encoding,video})
  507. Set preset for video stream.
  508. @var{preset} must be the path of a preset file.
  509. @end table
  510. @subsection Server status stream
  511. A server status stream is a special stream which is used to show
  512. statistics about the @command{ffserver} operations.
  513. It must be specified setting the option @option{Format} to
  514. @samp{status}.
  515. @section Redirect section
  516. A redirect section specifies where to redirect the requested URL to
  517. another page.
  518. A redirect section must be introduced by the line:
  519. @example
  520. <Redirect NAME>
  521. @end example
  522. where @var{NAME} is the name of the page which should be redirected.
  523. It only accepts the option @option{URL}, which specify the redirection
  524. URL.
  525. @chapter Stream examples
  526. @itemize
  527. @item
  528. Multipart JPEG
  529. @example
  530. <Stream test.mjpg>
  531. Feed feed1.ffm
  532. Format mpjpeg
  533. VideoFrameRate 2
  534. VideoIntraOnly
  535. NoAudio
  536. Strict -1
  537. </Stream>
  538. @end example
  539. @item
  540. Single JPEG
  541. @example
  542. <Stream test.jpg>
  543. Feed feed1.ffm
  544. Format jpeg
  545. VideoFrameRate 2
  546. VideoIntraOnly
  547. VideoSize 352x240
  548. NoAudio
  549. Strict -1
  550. </Stream>
  551. @end example
  552. @item
  553. Flash
  554. @example
  555. <Stream test.swf>
  556. Feed feed1.ffm
  557. Format swf
  558. VideoFrameRate 2
  559. VideoIntraOnly
  560. NoAudio
  561. </Stream>
  562. @end example
  563. @item
  564. ASF compatible
  565. @example
  566. <Stream test.asf>
  567. Feed feed1.ffm
  568. Format asf
  569. VideoFrameRate 15
  570. VideoSize 352x240
  571. VideoBitRate 256
  572. VideoBufferSize 40
  573. VideoGopSize 30
  574. AudioBitRate 64
  575. StartSendOnKey
  576. </Stream>
  577. @end example
  578. @item
  579. MP3 audio
  580. @example
  581. <Stream test.mp3>
  582. Feed feed1.ffm
  583. Format mp2
  584. AudioCodec mp3
  585. AudioBitRate 64
  586. AudioChannels 1
  587. AudioSampleRate 44100
  588. NoVideo
  589. </Stream>
  590. @end example
  591. @item
  592. Ogg Vorbis audio
  593. @example
  594. <Stream test.ogg>
  595. Feed feed1.ffm
  596. Metadata title "Stream title"
  597. AudioBitRate 64
  598. AudioChannels 2
  599. AudioSampleRate 44100
  600. NoVideo
  601. </Stream>
  602. @end example
  603. @item
  604. Real with audio only at 32 kbits
  605. @example
  606. <Stream test.ra>
  607. Feed feed1.ffm
  608. Format rm
  609. AudioBitRate 32
  610. NoVideo
  611. </Stream>
  612. @end example
  613. @item
  614. Real with audio and video at 64 kbits
  615. @example
  616. <Stream test.rm>
  617. Feed feed1.ffm
  618. Format rm
  619. AudioBitRate 32
  620. VideoBitRate 128
  621. VideoFrameRate 25
  622. VideoGopSize 25
  623. </Stream>
  624. @end example
  625. @item
  626. For stream coming from a file: you only need to set the input filename
  627. and optionally a new format.
  628. @example
  629. <Stream file.rm>
  630. File "/usr/local/httpd/htdocs/tlive.rm"
  631. NoAudio
  632. </Stream>
  633. @end example
  634. @example
  635. <Stream file.asf>
  636. File "/usr/local/httpd/htdocs/test.asf"
  637. NoAudio
  638. Metadata author "Me"
  639. Metadata copyright "Super MegaCorp"
  640. Metadata title "Test stream from disk"
  641. Metadata comment "Test comment"
  642. </Stream>
  643. @end example
  644. @end itemize
  645. @c man end
  646. @include config.texi
  647. @ifset config-all
  648. @ifset config-avutil
  649. @include utils.texi
  650. @end ifset
  651. @ifset config-avcodec
  652. @include codecs.texi
  653. @include bitstream_filters.texi
  654. @end ifset
  655. @ifset config-avformat
  656. @include formats.texi
  657. @include protocols.texi
  658. @end ifset
  659. @ifset config-avdevice
  660. @include devices.texi
  661. @end ifset
  662. @ifset config-swresample
  663. @include resampler.texi
  664. @end ifset
  665. @ifset config-swscale
  666. @include scaler.texi
  667. @end ifset
  668. @ifset config-avfilter
  669. @include filters.texi
  670. @end ifset
  671. @end ifset
  672. @chapter See Also
  673. @ifhtml
  674. @ifset config-all
  675. @url{ffserver.html,ffserver},
  676. @end ifset
  677. @ifset config-not-all
  678. @url{ffserver-all.html,ffserver-all},
  679. @end ifset
  680. the @file{doc/ffserver.conf} example,
  681. @url{ffmpeg.html,ffmpeg}, @url{ffplay.html,ffplay}, @url{ffprobe.html,ffprobe},
  682. @url{ffmpeg-utils.html,ffmpeg-utils},
  683. @url{ffmpeg-scaler.html,ffmpeg-scaler},
  684. @url{ffmpeg-resampler.html,ffmpeg-resampler},
  685. @url{ffmpeg-codecs.html,ffmpeg-codecs},
  686. @url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
  687. @url{ffmpeg-formats.html,ffmpeg-formats},
  688. @url{ffmpeg-devices.html,ffmpeg-devices},
  689. @url{ffmpeg-protocols.html,ffmpeg-protocols},
  690. @url{ffmpeg-filters.html,ffmpeg-filters}
  691. @end ifhtml
  692. @ifnothtml
  693. @ifset config-all
  694. ffserver(1),
  695. @end ifset
  696. @ifset config-not-all
  697. ffserver-all(1),
  698. @end ifset
  699. the @file{doc/ffserver.conf} example, ffmpeg(1), ffplay(1), ffprobe(1),
  700. ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
  701. ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
  702. ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)
  703. @end ifnothtml
  704. @include authors.texi
  705. @ignore
  706. @setfilename ffserver
  707. @settitle ffserver video server
  708. @end ignore
  709. @bye