ossrs / Srs Docker
Programming Languages
Labels
SRS
The docker images for SRS.
Usage
By default, ossrs/srs:3
is the latest SRS3 image,
others is here such as ossrs/srs:v3.0-r3.
Run SRS in docker by:
docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 ossrs/srs:3
Or speed up for developers in China by AliyunCR:
docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 \
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:3
After SRS is running, you can:
- Publish stream to SRS by
ffmpeg -re -i doc/source.200kbps.768x320.flv -c copy -f flv rtmp://127.0.0.1/live/livestream
- Play stream from SRS by
ffmpeg -f flv -i rtmp://127.0.0.1/live/livestream -f flv -y /dev/null
- Access the admin by http://localhost:8080/
Config
The config of docker is /usr/local/srs/conf/srs.conf
, and logging to console.
To overwrite the config by /path/of/yours.conf
:
docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 \
-v /path/of/yours.conf:/usr/local/srs/conf/srs.conf \
ossrs/srs:3
Note: How to write the correct config file, please read wiki(CN/EN).
FFMPEG
For #1523,
we copy the FFMEPG from ossrs/srs:dev,
and put to /usr/local/srs/objs/ffmpeg/bin/ffmpeg
which is the default value of configs.
You can replace it by docker -v
, for example:
docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 \
-v /path/of/ffmpeg:/usr/local/srs/objs/ffmpeg/bin/ffmpeg \
ossrs/srs:3
Remark: You can replace config, log and tools by specifying
-v
for each one.
Windows
For windows PowerShell, we start a demo stream, ingested by FFMPEG:
docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 `
-v $pwd/doc/source.200kbps.768x320.flv:/usr/local/srs/doc/source.200kbps.768x320.flv `
-v $pwd/conf/windows.conf:/usr/local/srs/conf/srs.conf `
ossrs/srs:3
Then, we can play the demo stream by:
- RTMP: rtmp://127.0.0.1/live/livestream
- FLV: http://127.0.0.1:8080/live/livestream.flv
- HLS: http://127.0.0.1:8080/live/livestream.m3u8
Winlin 2019.11