Changes between Version 3 and Version 4 of Streaming media with ffserver


Ignore:
Timestamp:
10/11/2012 04:30:44 AM (7 months ago)
Author:
burek
Comment:

Added examples

Legend:

Unmodified
Added
Removed
Modified
  • Streaming media with ffserver

    v3 v4  
    8484It would be very wise to start off reading the ffserver's [http://ffmpeg.org/sample.html sample configuration file]. It is self-documented with a lot of comments and it is a good starting point for beginners, since it contains various examples too. It would be a waste of time and space to write about it again here. Also, [http://ffmpeg.org/ffserver.html ffserver's documentation page] might help too. In general, the configuration file is consisted of global directives, list of feed elements, list of stream elements and a specification of a special status stream element, which is used to provide a way for you to view the status of all your running streams. 
    8585 
    86 = Examples = 
     86= Examples of configuration files = 
    8787 
    88 TODO: ''add some popular streaming examples, like:'' 
    89 - h264+aac in flv/ts 
    90 - theora/vorbis in ogg 
    91 - etc. 
     88=== Streaming H.264 video with AAC audio in FLV format === 
     89 
     90{{{ 
     91Port 8090 
     92BindAddress 0.0.0.0 
     93MaxHTTPConnections 2000 
     94MaxClients 1000 
     95MaxBandwidth 1000 
     96CustomLog - 
     97#NoDaemon 
     98 
     99<Feed feed1.ffm> 
     100        File /tmp/feed1.ffm 
     101        FileMaxSize 200K 
     102        ACL allow 127.0.0.1 
     103</Feed> 
     104 
     105# if you want to use mpegts format instead of flv 
     106# then change "live.flv" to "live.ts" 
     107# and also change "Format flv" to "Format mpegts" 
     108<Stream live.flv> 
     109        Format flv 
     110        Feed feed1.ffm 
     111 
     112        VideoCodec libx264 
     113        VideoFrameRate 30 
     114        VideoBitRate 512 
     115        VideoSize 320x240 
     116        AVOptionVideo crf 23 
     117        AVOptionVideo preset medium 
     118        # for more info on crf/preset options, type: x264 --help 
     119        AVOptionVideo flags +global_header 
     120 
     121        AudioCodec aac 
     122        Strict -2 
     123        AudioBitRate 128 
     124        AudioChannels 2 
     125        AudioSampleRate 44100 
     126        AVOptionAudio flags +global_header 
     127</Stream> 
     128 
     129################################################################## 
     130# Special streams 
     131################################################################## 
     132<Stream stat.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 
     139# Redirect index.html to the appropriate site 
     140<Redirect index.html> 
     141        URL http://www.ffmpeg.org/ 
     142</Redirect> 
     143################################################################## 
     144}}} 
     145 
     146=== Streaming Theora video with Orbis audio in Ogg format === 
     147 
     148{{{ 
     149Port 8090 
     150BindAddress 0.0.0.0 
     151MaxHTTPConnections 2000 
     152MaxClients 1000 
     153MaxBandwidth 1000 
     154CustomLog - 
     155#NoDaemon 
     156 
     157<Feed feed1.ffm> 
     158        File /tmp/feed1.ffm 
     159        FileMaxSize 200K 
     160        ACL allow 127.0.0.1 
     161</Feed> 
     162 
     163<Stream live.ogg> 
     164        Format ogg 
     165        Feed feed1.ffm 
     166 
     167        VideoCodec libtheora 
     168        VideoFrameRate 24 
     169        VideoBitRate 512 
     170        VideoSize 320x240 
     171        VideoQMin 1 
     172        VideoQMax 31 
     173        VideoGopSize 12 
     174        Preroll 0 
     175        AVOptionVideo flags +global_header 
     176 
     177        AudioCodec libvorbis 
     178        AudioBitRate 64 
     179        AudioChannels 2 
     180        AudioSampleRate 44100 
     181        AVOptionAudio flags +global_header 
     182</Stream> 
     183 
     184################################################################## 
     185# Special streams 
     186################################################################## 
     187<Stream stat.html> 
     188        Format status 
     189        # Only allow local people to get the status 
     190        ACL allow localhost 
     191        ACL allow 192.168.0.0 192.168.255.255 
     192</Stream> 
     193 
     194# Redirect index.html to the appropriate site 
     195<Redirect index.html> 
     196        URL http://www.ffmpeg.org/ 
     197</Redirect> 
     198################################################################## 
     199}}}