You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

921 lines
27KB

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