FFserver
Stream
스트리밍은 <Stream>
를 사용하면 된다. 이 경우 스트리밍할 포맷(Format
)을 정확히 입력해야 하며, Feed
또는 File
의 포맷이 일치해야 한다.
Example
아래와 같이 FFserver 설정파일을 생성한다. HTTP를 사용하는 8090과 RTPS를 사용하는 8091포트는 미리 방화벽을 풀어준다.
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>
설정파일을 사용하여 FFserver를 백그라운드에서 실행한다.
FFmpeg를 사용하여 카메라 영상을 FFserver에 전송한다.
참고로 아래와 같이 사용하면 현재 화면을 캡쳐할 수 있다.
아래와 같이 클라이언트에서 접속할 수 있다.
- 상태정보 페이지: http://localhost:8090/stat.html
- 카메라 스트리밍: http://localhost:8090/test.swf
- 카메라 스트리밍: rtps://localhost:8091/sample.mpg
또는 http://localhost:8090/sample.rtps 로 Redirection 할 수 있다.
More example
아래와 같은 방법으로 h264 스트리밍이 가능하다.
# 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
FFserver 사용시 발생할 수 있는 문제점 및 해결 방법에 대하여 정리한다.
Android MediaPlayer streaming
Favorite site
- [추천] wiki: ffserver
- Streaming media with ffserver
- StreamingGuide
- Sample ffserver configuration file
- 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
- webcam과 ffserver를 이용한 실시간 스트리밍 환경 구축하기
- Simple video streaming with ffserver
- [추천] Streaming live WebM video with FFmpeg
References
-
Ffmpeg_ffserver_streaming_server.pdf ↩