All Projects → ossrs → Srs Docker

ossrs / Srs Docker

Licence: mit
The dockerized SRS, use docker to run/debug/build SRS.

Programming Languages

javascript
184084 projects - #8 most used programming language

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:

Winlin 2019.11

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].