| 1 | # Port on which the server is listening. You must select a different
|
|---|
| 2 | # port from your standard HTTP web server if it is running on the same
|
|---|
| 3 | # computer.
|
|---|
| 4 | Port 8090
|
|---|
| 5 |
|
|---|
| 6 | # Address on which the server is bound. Only useful if you have
|
|---|
| 7 | # several network interfaces.
|
|---|
| 8 | BindAddress 0.0.0.0
|
|---|
| 9 |
|
|---|
| 10 | # Number of simultaneous HTTP connections that can be handled. It has
|
|---|
| 11 | # to be defined *before* the MaxClients parameter, since it defines the
|
|---|
| 12 | # MaxClients maximum limit.
|
|---|
| 13 | MaxHTTPConnections 2000
|
|---|
| 14 |
|
|---|
| 15 | # Number of simultaneous requests that can be handled. Since FFServer
|
|---|
| 16 | # is very fast, it is more likely that you will want to leave this high
|
|---|
| 17 | # and use MaxBandwidth, below.
|
|---|
| 18 | MaxClients 1000
|
|---|
| 19 |
|
|---|
| 20 | # This the maximum amount of kbit/sec that you are prepared to
|
|---|
| 21 | # consume when streaming to clients.
|
|---|
| 22 | MaxBandwidth 1000
|
|---|
| 23 |
|
|---|
| 24 | # Access log file (uses standard Apache log file format)
|
|---|
| 25 | # '-' is the standard output.
|
|---|
| 26 | CustomLog -
|
|---|
| 27 |
|
|---|
| 28 | ##################################################################
|
|---|
| 29 | # Definition of the live feeds. Each live feed contains one video
|
|---|
| 30 | # and/or audio sequence coming from an ffmpeg encoder or another
|
|---|
| 31 | # ffserver. This sequence may be encoded simultaneously with several
|
|---|
| 32 | # codecs at several resolutions.
|
|---|
| 33 |
|
|---|
| 34 | <Feed feed1.ffm>
|
|---|
| 35 |
|
|---|
| 36 | # You must use 'ffmpeg' to send a live feed to ffserver. In this
|
|---|
| 37 | # example, you can type:
|
|---|
| 38 | #
|
|---|
| 39 | # ffmpeg http://localhost:8090/feed1.ffm
|
|---|
| 40 |
|
|---|
| 41 | # ffserver can also do time shifting. It means that it can stream any
|
|---|
| 42 | # previously recorded live stream. The request should contain:
|
|---|
| 43 | # "http://xxxx?date=[YYYY-MM-DDT][[HH:]MM:]SS[.m...]".You must specify
|
|---|
| 44 | # a path where the feed is stored on disk. You also specify the
|
|---|
| 45 | # maximum size of the feed, where zero means unlimited. Default:
|
|---|
| 46 | # File=/tmp/feed_name.ffm FileMaxSize=5M
|
|---|
| 47 | File /tmp/feed1.ffm
|
|---|
| 48 | #File /root/out.avi
|
|---|
| 49 | FileMaxSize 50M
|
|---|
| 50 |
|
|---|
| 51 | # You could specify
|
|---|
| 52 | # ReadOnlyFile /saved/specialvideo.ffm
|
|---|
| 53 | # This marks the file as readonly and it will not be deleted or updated.
|
|---|
| 54 |
|
|---|
| 55 | # Specify launch in order to start ffmpeg automatically.
|
|---|
| 56 | # First ffmpeg must be defined with an appropriate path if needed,
|
|---|
| 57 | # after that options can follow, but avoid adding the http:// field
|
|---|
| 58 | #Launch ffmpeg -f v4l2 -r 25 -s 640*480 -i /dev/video0 out.avi
|
|---|
| 59 |
|
|---|
| 60 | # Only allow connections from localhost to the feed.
|
|---|
| 61 |
|
|---|
| 62 | ACL allow 127.0.0.1
|
|---|
| 63 | ACL allow localhost
|
|---|
| 64 | ACL allow 192.168.0.0 192.168.255.255
|
|---|
| 65 |
|
|---|
| 66 | NoAudio
|
|---|
| 67 |
|
|---|
| 68 | </Feed>
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 | ##################################################################
|
|---|
| 72 | # Now you can define each stream which will be generated from the
|
|---|
| 73 | # original audio and video stream. Each format has a filename (here
|
|---|
| 74 | # 'test1.mpg'). FFServer will send this stream when answering a
|
|---|
| 75 | # request containing this filename.
|
|---|
| 76 |
|
|---|
| 77 | <Stream test1.avi>
|
|---|
| 78 |
|
|---|
| 79 | # coming from live feed 'feed1'
|
|---|
| 80 | Feed feed1.ffm
|
|---|
| 81 | #Feed specialvideo.ffm
|
|---|
| 82 |
|
|---|
| 83 | # Format of the stream : you can choose among:
|
|---|
| 84 | # mpeg : MPEG-1 multiplexed video and audio
|
|---|
| 85 | # mpegvideo : only MPEG-1 video
|
|---|
| 86 | # mp2 : MPEG-2 audio (use AudioCodec to select layer 2 and 3 codec)
|
|---|
| 87 | # ogg : Ogg format (Vorbis audio codec)
|
|---|
| 88 | # rm : RealNetworks-compatible stream. Multiplexed audio and video.
|
|---|
| 89 | # ra : RealNetworks-compatible stream. Audio only.
|
|---|
| 90 | # mpjpeg : Multipart JPEG (works with Netscape without any plugin)
|
|---|
| 91 | # jpeg : Generate a single JPEG image.
|
|---|
| 92 | # asf : ASF compatible streaming (Windows Media Player format).
|
|---|
| 93 | # swf : Macromedia Flash compatible stream
|
|---|
| 94 | # avi : AVI format (MPEG-4 video, MPEG audio sound)
|
|---|
| 95 | Format avi
|
|---|
| 96 |
|
|---|
| 97 | # Bitrate for the audio stream. Codecs usually support only a few
|
|---|
| 98 | # different bitrates.
|
|---|
| 99 | #AudioBitRate 32
|
|---|
| 100 |
|
|---|
| 101 | # Number of audio channels: 1 = mono, 2 = stereo
|
|---|
| 102 | #AudioChannels 1
|
|---|
| 103 |
|
|---|
| 104 | # Sampling frequency for audio. When using low bitrates, you should
|
|---|
| 105 | # lower this frequency to 22050 or 11025. The supported frequencies
|
|---|
| 106 | # depend on the selected audio codec.
|
|---|
| 107 | #AudioSampleRate 44100
|
|---|
| 108 |
|
|---|
| 109 | # Bitrate for the video stream
|
|---|
| 110 | VideoBitRate 64
|
|---|
| 111 |
|
|---|
| 112 | # Ratecontrol buffer size
|
|---|
| 113 | #VideoBufferSize 40
|
|---|
| 114 | VideoBufferSize 100
|
|---|
| 115 |
|
|---|
| 116 | # Number of frames per second
|
|---|
| 117 | VideoFrameRate 3
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 | # Size of the video frame: WxH (default: 160x128)
|
|---|
| 121 | # The following abbreviations are defined: sqcif, qcif, cif, 4cif, qqvga,
|
|---|
| 122 | # qvga, vga, svga, xga, uxga, qxga, sxga, qsxga, hsxga, wvga, wxga, wsxga,
|
|---|
| 123 | # wuxga, woxga, wqsxga, wquxga, whsxga, whuxga, cga, ega, hd480, hd720,
|
|---|
| 124 | # hd1080
|
|---|
| 125 | VideoSize 320x240
|
|---|
| 126 |
|
|---|
| 127 | # Transmit only intra frames (useful for low bitrates, but kills frame rate).
|
|---|
| 128 | #VideoIntraOnly
|
|---|
| 129 |
|
|---|
| 130 | # If non-intra only, an intra frame is transmitted every VideoGopSize
|
|---|
| 131 | # frames. Video synchronization can only begin at an intra frame.
|
|---|
| 132 | VideoGopSize 12
|
|---|
| 133 |
|
|---|
| 134 | # More MPEG-4 parameters
|
|---|
| 135 | # VideoHighQuality
|
|---|
| 136 | # Video4MotionVector
|
|---|
| 137 |
|
|---|
| 138 | # Choose your codecs:
|
|---|
| 139 | #AudioCodec mp2
|
|---|
| 140 | #VideoCodec mpeg1video
|
|---|
| 141 |
|
|---|
| 142 | # Suppress audio
|
|---|
| 143 | NoAudio
|
|---|
| 144 |
|
|---|
| 145 | # Suppress video
|
|---|
| 146 | #NoVideo
|
|---|
| 147 |
|
|---|
| 148 | #VideoQMin 3
|
|---|
| 149 | #VideoQMax 31
|
|---|
| 150 |
|
|---|
| 151 | # Set this to the number of seconds backwards in time to start. Note that
|
|---|
| 152 | # most players will buffer 5-10 seconds of video, and also you need to allow
|
|---|
| 153 | # for a keyframe to appear in the data stream.
|
|---|
| 154 | #Preroll 15
|
|---|
| 155 |
|
|---|
| 156 | # ACL:
|
|---|
| 157 |
|
|---|
| 158 | # You can allow ranges of addresses (or single addresses)
|
|---|
| 159 | #ACL ALLOW <first address> <last address>
|
|---|
| 160 |
|
|---|
| 161 | # You can deny ranges of addresses (or single addresses)
|
|---|
| 162 | #ACL DENY <first address> <last address>
|
|---|
| 163 |
|
|---|
| 164 | # You can repeat the ACL allow/deny as often as you like. It is on a per
|
|---|
| 165 | # stream basis. The first match defines the action. If there are no matches,
|
|---|
| 166 | # then the default is the inverse of the last ACL statement.
|
|---|
| 167 | #
|
|---|
| 168 | # Thus 'ACL allow localhost' only allows access from localhost.
|
|---|
| 169 | # 'ACL deny 1.0.0.0 1.255.255.255' would deny the whole of network 1 and
|
|---|
| 170 | # allow everybody else.
|
|---|
| 171 | ACL allow 127.0.0.1
|
|---|
| 172 | ACL allow localhost
|
|---|
| 173 | ACL allow 192.168.0.0 192.168.255.255
|
|---|
| 174 | </Stream>
|
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 | ##################################################################
|
|---|
| 178 | # Example streams
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 | # Multipart JPEG
|
|---|
| 182 |
|
|---|
| 183 | #<Stream test.mjpg>
|
|---|
| 184 | #Feed feed1.ffm
|
|---|
| 185 | #Format mpjpeg
|
|---|
| 186 | #VideoFrameRate 2
|
|---|
| 187 | #VideoIntraOnly
|
|---|
| 188 | #NoAudio
|
|---|
| 189 | #Strict -1
|
|---|
| 190 | #</Stream>
|
|---|
| 191 |
|
|---|
| 192 |
|
|---|
| 193 | # Single JPEG
|
|---|
| 194 |
|
|---|
| 195 | #<Stream test.jpg>
|
|---|
| 196 | #Feed feed1.ffm
|
|---|
| 197 | #Format jpeg
|
|---|
| 198 | #VideoFrameRate 2
|
|---|
| 199 | #VideoIntraOnly
|
|---|
| 200 | ##VideoSize 352x240
|
|---|
| 201 | #NoAudio
|
|---|
| 202 | #Strict -1
|
|---|
| 203 | #</Stream>
|
|---|
| 204 |
|
|---|
| 205 |
|
|---|
| 206 | # Flash
|
|---|
| 207 |
|
|---|
| 208 | #<Stream test.swf>
|
|---|
| 209 | #Feed feed1.ffm
|
|---|
| 210 | #Format swf
|
|---|
| 211 | #VideoFrameRate 2
|
|---|
| 212 | #VideoIntraOnly
|
|---|
| 213 | #NoAudio
|
|---|
| 214 | #</Stream>
|
|---|
| 215 |
|
|---|
| 216 |
|
|---|
| 217 | # ASF compatible
|
|---|
| 218 |
|
|---|
| 219 | #<Stream test.asf>
|
|---|
| 220 | #Feed feed1.ffm
|
|---|
| 221 | #Format asf
|
|---|
| 222 | #VideoFrameRate 15
|
|---|
| 223 | #VideoSize 352x240
|
|---|
| 224 | #VideoBitRate 256
|
|---|
| 225 | #VideoBufferSize 40
|
|---|
| 226 | #VideoGopSize 30
|
|---|
| 227 | #AudioBitRate 64
|
|---|
| 228 | #StartSendOnKey
|
|---|
| 229 | #</Stream>
|
|---|
| 230 |
|
|---|
| 231 |
|
|---|
| 232 | # MP3 audio
|
|---|
| 233 |
|
|---|
| 234 | #<Stream test.mp3>
|
|---|
| 235 | #Feed feed1.ffm
|
|---|
| 236 | #Format mp2
|
|---|
| 237 | #AudioCodec mp3
|
|---|
| 238 | #AudioBitRate 64
|
|---|
| 239 | #AudioChannels 1
|
|---|
| 240 | #AudioSampleRate 44100
|
|---|
| 241 | #NoVideo
|
|---|
| 242 | #</Stream>
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 | # Ogg Vorbis audio
|
|---|
| 246 |
|
|---|
| 247 | #<Stream test.ogg>
|
|---|
| 248 | #Feed feed1.ffm
|
|---|
| 249 | #Title "Stream title"
|
|---|
| 250 | #AudioBitRate 64
|
|---|
| 251 | #AudioChannels 2
|
|---|
| 252 | #AudioSampleRate 44100
|
|---|
| 253 | #NoVideo
|
|---|
| 254 | #</Stream>
|
|---|
| 255 |
|
|---|
| 256 |
|
|---|
| 257 | # Real with audio only at 32 kbits
|
|---|
| 258 |
|
|---|
| 259 | #<Stream test.ra>
|
|---|
| 260 | #Feed feed1.ffm
|
|---|
| 261 | #Format rm
|
|---|
| 262 | #AudioBitRate 32
|
|---|
| 263 | #NoVideo
|
|---|
| 264 | #NoAudio
|
|---|
| 265 | #</Stream>
|
|---|
| 266 |
|
|---|
| 267 |
|
|---|
| 268 | # Real with audio and video at 64 kbits
|
|---|
| 269 |
|
|---|
| 270 | #<Stream test.rm>
|
|---|
| 271 | #Feed feed1.ffm
|
|---|
| 272 | #Format rm
|
|---|
| 273 | #AudioBitRate 32
|
|---|
| 274 | #VideoBitRate 128
|
|---|
| 275 | #VideoFrameRate 25
|
|---|
| 276 | #VideoGopSize 25
|
|---|
| 277 | #NoAudio
|
|---|
| 278 | #</Stream>
|
|---|
| 279 |
|
|---|
| 280 |
|
|---|
| 281 | ##################################################################
|
|---|
| 282 | # A stream coming from a file: you only need to set the input
|
|---|
| 283 | # filename and optionally a new format. Supported conversions:
|
|---|
| 284 | # AVI -> ASF
|
|---|
| 285 |
|
|---|
| 286 | #<Stream file.avi>
|
|---|
| 287 | #File "/root/cube4.avi"
|
|---|
| 288 | #NoAudio
|
|---|
| 289 | #ACL allow 192.168.0.0 192.168.255.255
|
|---|
| 290 | #</Stream>
|
|---|
| 291 |
|
|---|
| 292 | #<Stream file.asf>
|
|---|
| 293 | #File "/usr/local/httpd/htdocs/test.asf"
|
|---|
| 294 | #NoAudio
|
|---|
| 295 | #Author "Me"
|
|---|
| 296 | #Copyright "Super MegaCorp"
|
|---|
| 297 | #Title "Test stream from disk"
|
|---|
| 298 | #Comment "Test comment"
|
|---|
| 299 | #</Stream>
|
|---|
| 300 |
|
|---|
| 301 |
|
|---|
| 302 | ##################################################################
|
|---|
| 303 | # RTSP examples
|
|---|
| 304 | #
|
|---|
| 305 | # You can access this stream with the RTSP URL:
|
|---|
| 306 | # rtsp://localhost:5454/test1-rtsp.mpg
|
|---|
| 307 | #
|
|---|
| 308 | # A non-standard RTSP redirector is also created. Its URL is:
|
|---|
| 309 | # http://localhost:8090/test1-rtsp.rtsp
|
|---|
| 310 |
|
|---|
| 311 | #<Stream test1-rtsp.mpg>
|
|---|
| 312 | #Format rtp
|
|---|
| 313 | #File "/usr/local/httpd/htdocs/test1.mpg"
|
|---|
| 314 | #</Stream>
|
|---|
| 315 |
|
|---|
| 316 |
|
|---|
| 317 | # Transcode an incoming live feed to another live feed,
|
|---|
| 318 | # using libx264 and video presets
|
|---|
| 319 |
|
|---|
| 320 | #<Stream live.h264>
|
|---|
| 321 | #Format rtp
|
|---|
| 322 | #Feed feed1.ffm
|
|---|
| 323 | #VideoCodec libx264
|
|---|
| 324 | #VideoFrameRate 24
|
|---|
| 325 | #VideoBitRate 100
|
|---|
| 326 | #VideoSize 480x272
|
|---|
| 327 | #AVPresetVideo default
|
|---|
| 328 | #AVPresetVideo baseline
|
|---|
| 329 | #AVOptionVideo flags +global_header
|
|---|
| 330 | #
|
|---|
| 331 | #AudioCodec libfaac
|
|---|
| 332 | #AudioBitRate 32
|
|---|
| 333 | #AudioChannels 2
|
|---|
| 334 | #AudioSampleRate 22050
|
|---|
| 335 | #AVOptionAudio flags +global_header
|
|---|
| 336 | #</Stream>
|
|---|
| 337 |
|
|---|
| 338 | ##################################################################
|
|---|
| 339 | # SDP/multicast examples
|
|---|
| 340 | #
|
|---|
| 341 | # If you want to send your stream in multicast, you must set the
|
|---|
| 342 | # multicast address with MulticastAddress. The port and the TTL can
|
|---|
| 343 | # also be set.
|
|---|
| 344 | #
|
|---|
| 345 | # An SDP file is automatically generated by ffserver by adding the
|
|---|
| 346 | # 'sdp' extension to the stream name (here
|
|---|
| 347 | # http://localhost:8090/test1-sdp.sdp). You should usually give this
|
|---|
| 348 | # file to your player to play the stream.
|
|---|
| 349 | #
|
|---|
| 350 | # The 'NoLoop' option can be used to avoid looping when the stream is
|
|---|
| 351 | # terminated.
|
|---|
| 352 |
|
|---|
| 353 | #<Stream test1-sdp.mpg>
|
|---|
| 354 | #Format rtp
|
|---|
| 355 | #File "/usr/local/httpd/htdocs/test1.mpg"
|
|---|
| 356 | #MulticastAddress 224.124.0.1
|
|---|
| 357 | #MulticastPort 5000
|
|---|
| 358 | #MulticastTTL 16
|
|---|
| 359 | #NoLoop
|
|---|
| 360 | #</Stream>
|
|---|
| 361 |
|
|---|
| 362 |
|
|---|
| 363 | ##################################################################
|
|---|
| 364 | # Special streams
|
|---|
| 365 |
|
|---|
| 366 | # Server status
|
|---|
| 367 |
|
|---|
| 368 | <Stream stat.html>
|
|---|
| 369 | Format status
|
|---|
| 370 |
|
|---|
| 371 | # Only allow local people to get the status
|
|---|
| 372 | ACL allow localhost
|
|---|
| 373 | ACL allow 192.168.0.0 192.168.255.255
|
|---|
| 374 |
|
|---|
| 375 | #FaviconURL http://pond1.gladstonefamily.net:8080/favicon.ico
|
|---|
| 376 | </Stream>
|
|---|
| 377 |
|
|---|
| 378 |
|
|---|
| 379 | # Redirect index.html to the appropriate site
|
|---|
| 380 |
|
|---|
| 381 | <Redirect index.html>
|
|---|
| 382 | URL http://www.ffmpeg.org/
|
|---|
| 383 | </Redirect>
|
|---|