GithubHelp home page GithubHelp logo

oaup / srs-docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pipilavvy/srs-docker

0.0 1.0 0.0 25.5 MB

The dockerized SRS.

License: MIT License

Dockerfile 0.47% Shell 1.72% HTML 72.07% JavaScript 25.61% CSS 0.12%

srs-docker's Introduction

SRS

The docker images for SRS.

Usage

For SRS3 and tags.

Run SRS in docker by:

docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 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 console by http://127.0.0.1:1985/console

The env of docker is bellow:

  • config file: /usr/local/srs/conf/srs.conf
  • log file: /usr/local/srs/objs/srs.log

To overwrite the config by /path/of/yours.conf and gather log to /path/of/yours.log:

docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 \
    -v /path/of/yours.conf:/usr/local/srs/conf/srs.conf \
    -v /path/of/yours.log:/usr/local/srs/objs/srs.log \
    ossrs/srs:3

Note: You should create the log file by mkdir -p /path/of && touch /path/of/yours.log, then start SRS.

Note: How to write the correct config file, please read wiki(CN/EN).

Aliyun

To use docker images in AliyunCR, please use registry.cn-hangzhou.aliyuncs.com/ossrs/srs.

For example:

docker run registry.cn-hangzhou.aliyuncs.com/ossrs/srs:3

Note: Strongly recommend to use AliyunCR, because it's is much faster and has all tags.

Origin Cluster

Download config and script files:

git clone https://github.com/ossrs/srs-docker.git &&
cd srs-docker/3.0

Start origin serverA:

HostIP=`./auto/get_host_ip.sh` &&
docker run -p 19350:19350 -p 9090:9090 --add-host=docker:${HostIP} \
    -v `pwd`/conf/origin.cluster.serverA.conf:/usr/local/srs/conf/srs.conf \
    ossrs/srs:3

Start origin serverB:

HostIP=`./auto/get_host_ip.sh` &&
docker run -p 19351:19351 -p 9091:9091 --add-host=docker:${HostIP} \
    -v `pwd`/conf/origin.cluster.serverB.conf:/usr/local/srs/conf/srs.conf \
    ossrs/srs:3

Start edge server:

HostIP=`./auto/get_host_ip.sh` &&
docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 --add-host=docker:${HostIP} \
    -v `pwd`/conf/origin.cluster.edge.conf:/usr/local/srs/conf/srs.conf \
    ossrs/srs:3

Publish stream to edge server(or any origin server):

ffmpeg -re -i doc/source.200kbps.768x320.flv -c copy -f flv rtmp://127.0.0.1/live/livestream

Play stream from edge:

ffmpeg -f flv -i rtmp://127.0.0.1/live/livestream -f flv -y /dev/null

If now streaming to serverA, we can stop it then restart the publisher, then the edge will choose serverB and stream to it.

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 -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.

Debug

For debuggging:

  • Check files of docker: docker run -it ossrs/srs bash
  • Use specified versions: docker run -it ossrs/srs:v3.0-a2 bash
  • Use gdb to debug SRS, please use dev.

Winlin 2019.11

srs-docker's People

Contributors

winlinvip avatar pmextra avatar huanghe2015 avatar thecodeassassin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.