Skip to content

Guide · Open source

How to use SRS: run the media server with Docker

Updated · written with AI from the project's own documentation and checked against our catalogue data

SRS (Simple Realtime Server) is an open-source, MIT-licensed media server that receives live video and audio and sends it out to viewers in the formats they need. This guide is for developers and operators who are comfortable with the command line and networking. After reading it, you will be able to start SRS with Docker, publish a test stream with FFmpeg or OBS, and play that stream in several players.

SRSossrs/srs · ★ 29.4k · MIT

Quick start

  1. 1Install Docker. Docker is the prerequisite named for the recommended install method. Make sure it is installed and running on your machine.
  2. 2Start SRS. Run the docker run command from the README, publishing ports 1935, 1985, 8080, 8000/udp and 10080/udp.
  3. 3Verify the server. Open http://localhost:8080/ in a browser to check that SRS responds.
  4. 4Publish a stream. Send a stream with the README's FFmpeg command or set up OBS with the Custom service, rtmp://localhost/live and the key livestream.
  5. 5Play the stream. Open the RTMP URL in VLC, or the HTTP-FLV and HLS URLs in a browser player.

What SRS does and who it is for

SRS is described in its README as a simple, high-performance, AI-driven real-time media server. A broadcaster publishes one stream to SRS, and SRS can deliver it over protocols such as RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH and GB28181.

SRS is a server you have to run and configure. It suits developers building live streaming backends, teams that need to convert between RTMP and WebRTC, and people hosting their own low-latency live video service. It is not a point-and-click app for casual watching or streaming.

  • Supported codecs listed in the README: H.264, H.265, AV1, VP9, AAC, Opus and G.711.
  • The README lists Linux and macOS on several CPU architectures, and native Windows x64 support.

Start SRS with Docker

The README recommends running SRS with Docker. Docker is the only prerequisite named for this method. Run the following command, which publishes the ports SRS uses in the README example.

After the container starts, open http://localhost:8080/ in a browser to verify that SRS is running.

docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 -p 8000:8000/udp -p 10080:10080/udp ossrs/srs:6

Publish a stream with FFmpeg or OBS

To send a test stream, the README gives an FFmpeg command that reads a sample file and publishes it over RTMP to the live application under the stream name livestream.

You can also use OBS. In OBS, set the service to Custom, the server to rtmp://localhost/live and the stream key to livestream.

  • FFmpeg is available from ffmpeg.org and OBS from obsproject.com, as linked in the README.
ffmpeg -re -i ./doc/source.flv -c copy -f flv -y rtmp://localhost/live/livestream

Play the stream in a player

Once a stream is publishing, you can watch it in several ways. The README describes three options: VLC, the HTTP-FLV stream in a web page, and the HLS stream.

To use VLC, open the player, go to Media > Open Network Stream, enter rtmp://localhost/live/livestream and click Play. For HTTP-FLV and HLS, the README links to a browser player called srs-player, using the URLs http://localhost:8080/live/livestream.flv and http://localhost:8080/live/livestream.m3u8.

  • RTMP: rtmp://localhost/live/livestream (VLC)
  • HTTP-FLV: http://localhost:8080/live/livestream.flv
  • HLS: http://localhost:8080/live/livestream.m3u8

Convert between RTMP and WebRTC

The README does not walk through WebRTC setup itself. It points to the Getting Started guide, which has a WebRTC section, for steps on using WebRTC or converting RTMP to WebRTC and WebRTC to RTMP.

Read that section before you build anything on WebRTC, because the README only links to it.

Find more documentation

The README lists further topics covered in the documents: RTMP, HLS, HTTP-FLV, SRT, MPEG-DASH, WebRTC, clustering, the HTTP API, DVR and transcoding. Documentation is available in English and Chinese.

The README also mentions an AI Agent wiki page for understanding and maintaining an SRS deployment.

What people use it for

  • Building a live streaming backend that delivers one published stream over several protocols.
  • Converting an RTMP stream to WebRTC, or a WebRTC stream to RTMP, for a web viewing experience.
  • Hosting a self-run low-latency live video service.
  • Testing a publish-and-play pipeline locally with FFmpeg or OBS before deploying.

Frequently asked questions

Is SRS free to use?

The README says SRS is licensed under the MIT license, and it links to the license file. Third-party libraries inside SRS are distributed under their own licenses, which the README also links to.

What do I need to run SRS?

The README names Docker as the prerequisite for its recommended install method. You also need an encoder or broadcasting tool such as FFmpeg or OBS to send a stream, and a media player to watch it.

Can SRS run on Windows?

Yes, according to the README, which says SRS runs natively on Windows x64 and links to Windows documentation. Linux and macOS are also supported.

Why can't I open localhost:8080 after starting SRS?

Check that the container is running and that the port mappings match the README command, including 8080:8080. The README uses localhost:8080 for verification, so a different port mapping will change the address you need.

How does SRS compare to Nginx-RTMP, MediaMTX, Janus Gateway or Ant Media Server Community Edition?

The source lists these as comparable projects but does not compare their features, performance or licences. Check each project's documentation against your protocol, codec and deployment needs before choosing.

Do I need to know the command line to use SRS?

Yes. The README says it is aimed at operators comfortable with the command line and networking, and it recommends a Docker setup with terminal commands.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

SRS suits developers and operators who want to run their own live streaming server and deliver one stream over RTMP, WebRTC, HLS, HTTP-FLV and other protocols. It is MIT-licensed and can be started with a single Docker command. If you only want to watch or stream casually, or you want a point-and-click tool, pick a hosted service or a simpler application instead.

Install options & downloads