1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:31 +02:00

update ffserver

This commit is contained in:
kev 2016-07-05 03:33:59 +08:00
parent 4bb73644f1
commit 7bded15bc5
5 changed files with 101 additions and 38 deletions

View File

@ -1,14 +1,13 @@
#
# Dockerfile for ffmpeg
# Dockerfile for ffserver
#
FROM alpine
FROM vimagick/ffmpeg
MAINTAINER kev <noreply@easypi.info>
RUN apk add -U ffmpeg
COPY ffserver.conf /etc/
ADD ffserver.conf /etc/
EXPOSE 554 8090
EXPOSE 8090
CMD ["ffserver"]
ENTRYPOINT ["ffserver"]

View File

@ -1,21 +1,24 @@
ffserver - FFserver video server
================================
`FFserver` is a streaming server for both audio and video. It supports
![](https://badge.imagelayers.io/vimagick/ffserver:latest.svg)
[FFserver][1] is a streaming server for both audio and video. It supports
several live feeds, streaming from files and time shifting on live
feeds (you can seek to positions in the past on each live feed,
provided you specify a big enough feed storage in `ffserver.conf`).
## docker-compose.yml
```
```yaml
ffserver:
image: vimagick/ffserver
ports:
- "554:554"
- "8090:8090"
volumes:
- ffserver.conf:/etc/ffserver.conf
- data:/data
- ./ffserver.conf:/etc/ffserver.conf
- ./data:/data
restart: always
```
@ -25,22 +28,33 @@ ffserver:
HTTPPort 8090
HTTPBindAddress 0.0.0.0
RTSPPort 554
RTSPBindAddress 0.0.0.0
MaxClients 100
MaxBandwidth 100000
CustomLog -
<Feed feed.ffm>
File /tmp/feed.ffm
File /data/feed.ffm
</Feed>
<Stream feed.mp3>
<Stream video.mp4>
Format rtp
Feed feed.ffm
Format mp2
AudioCodec libmp3lame
AudioBitRate 64
AudioChannels 1
AudioSampleRate 44100
NoVideo
VideoCodec libx264
VideoFrameRate 24
VideoBitRate 100
VideoSize 640x480
AVPresetVideo default
AVPresetVideo baseline
AVOptionVideo flags +global_header
NoAudio
#AudioCodec libmp3lame
#AudioBitRate 32
#AudioChannels 2
#AudioSampleRate 22050
#AVOptionAudio flags +global_header
</Stream>
<Stream status.html>
@ -48,29 +62,43 @@ Format status
</Stream>
```
> WARNING: I've not figured out how to stream video yet!
> :warning: I've not figured out how to stream video+audio yet!
## server
## Server Setup
```
```bash
$ cd ~/fig/ffserver
$ tree
.
├── data
│ └── feed.mp3
│ └── video.mp4
├── docker-compose.yml
└── ffserver.conf
$ docker-compose up -d
$ docker exec ffserver_ffserver_1 ffmpeg -i /data/feed.mp3 http://localhost:8090/feed.ffm
$ docker-compose exec ffserver ffmpeg -re -i video.mp4 http://localhost:8090/feed.ffm
```
## client
> :hammer: `data/video.mp4` is for testing purposes only.
```
$ firefox http://server:8090/status.html
## Client Setup
$ firefox http://server:8090/feed.mp3
```bash
$ ffmpeg -re -i video.mp4 http://easypi.info:8090/feed.ffm
```
## Player Setup
```bash
$ ffplay rtsp://easypi.info/video.mp4
$ vlc http://easypi.info:8090/video.rtsp
$ firefox http://easypi.info:8090/status.html
```
## References
- <http://ffmpeg.org/ffserver.html>
- <http://www.ffmpeg.org/sample.html>
- <https://trac.ffmpeg.org/wiki/ffserver>
[1]: https://www.ffmpeg.org/ffserver.html

View File

@ -1,6 +1,7 @@
ffserver:
image: vimagick/ffserver
ports:
- "554:554"
- "8090:8090"
volumes:
- ./ffserver.conf:/etc/ffserver.conf

View File

@ -1,22 +1,33 @@
HTTPPort 8090
HTTPBindAddress 0.0.0.0
RTSPPort 554
RTSPBindAddress 0.0.0.0
MaxClients 100
MaxBandwidth 100000
CustomLog -
<Feed feed.ffm>
File /tmp/feed.ffm
File /data/feed.ffm
</Feed>
<Stream feed.mp3>
<Stream video.mp4>
Format rtp
Feed feed.ffm
Format mp2
AudioCodec libmp3lame
AudioBitRate 64
AudioChannels 1
AudioSampleRate 44100
NoVideo
VideoCodec libx264
VideoFrameRate 24
VideoBitRate 100
VideoSize 640x480
AVPresetVideo default
AVPresetVideo baseline
AVOptionVideo flags +global_header
NoAudio
#AudioCodec libmp3lame
#AudioBitRate 32
#AudioChannels 2
#AudioSampleRate 22050
#AVOptionAudio flags +global_header
</Stream>
<Stream status.html>

View File

@ -17,8 +17,32 @@ red5:
restart: always
```
## Server Setup
```bash
$ docker-compose up -d
```
## Client Setup
```bash
$ ffmpeg -i /dev/video0 -video_size 800x600 -f flv rtmp://easypi.info/live/webcam
```
## Player Setup
```bash
# kodi
$ echo 'rtmp://easypi.info/live/webcam live=1' > ~/Movies/webcam.strm
# ffplay
$ brew reinstall ffmpeg --with-ffplay --with-rtmpdump
$ ffplay 'rtmp://easypi.info/live/webcam live=1'
```
## references
- <https://github.com/Red5/docker>
- <http://kodi.wiki/view/Internet_video_and_audio_streams>
[1]: https://github.com/Red5/red5-server