FFserver
lastmod 2025-02-14created 2015-05-1512 edits
Stream
For streaming, use <Stream>. In this case you must specify the streaming format (Format) exactly, and it must match the format of the Feed or File.
Example
Create an FFserver configuration file as shown below. Open ports 8090 (HTTP) and 8091 (RTPS) in the firewall beforehand.
Port 8090
RTSPPort 8091
# bind to all IPs aliased or not
BindAddress 0.0.0.0
# max number of simultaneous clients
MaxClients 1000
# max bandwidth per-client (kb/s)
MaxBandwidth 10000
# Suppress that if you want to launch ffserver as a daemon.
NoDaemon
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 5M
</Feed>
<Stream test.swf>
Feed feed1.ffm
Format swf
VideoCodec flv
VideoFrameRate 15
VideoBufferSize 80000
VideoBitRate 100
VideoQMin 1
VideoQMax 5
VideoSize 352x288
PreRoll 0
Noaudio
</Stream>
<Stream sample.mpg>
Format rtp
File "/home/your/Downloads/test1.mpg"
</Stream>
<Stream stat.html>
Format status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
</Stream>
Run FFserver in the background with the configuration file.
Send the camera video to FFserver using FFmpeg.
For reference, the following captures the current screen.
Clients can connect as follows.
- Status page: http://localhost:8090/stat.html
- Camera streaming: http://localhost:8090/test.swf
- Camera streaming: rtps://localhost:8091/sample.mpg
or redirect via http://localhost:8090/sample.rtps.
More example
H264 streaming is possible as follows.
# Transcode an incoming live feed to another live feed,
# using libx264 and video presets
<Stream live.h264>
Format rtp
Feed feed1.ffm
VideoCodec libx264
VideoFrameRate 24
VideoBitRate 100
VideoSize 480x272
AVPresetVideo default
AVPresetVideo baseline
AVOptionVideo flags +global_header
AudioCodec libfaac
AudioBitRate 32
AudioChannels 2
AudioSampleRate 22050
AVOptionAudio flags +global_header
</Stream>
See also
Troubleshooting
A collection of problems that can occur when using FFserver and their solutions.
Android MediaPlayer streaming
Favorite site
- [Recommended] wiki: ffserver
- Streaming media with ffserver
- StreamingGuide
- Sample ffserver configuration file
- Building a streaming server with RED5 + FFmpeg + FFserver 1
Streaming
- Play with ffserver – a quick overview
- How to install ffmpeg on CentOS or Redhat Enteprirse Linux the easy way
- 2. Streaming with VLC + FFserver
- Setting up a real-time streaming environment with a webcam and ffserver
- Simple video streaming with ffserver
- [Recommended] Streaming live WebM video with FFmpeg
References
-
Ffmpeg_ffserver_streaming_server.pdf ↩
Pages that link here