-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
migrate_v4_EN_introduction
Remark: SRS4 is released at 2021.12 and stable now.
SRS is a simple, high efficiency and realtime video server, supports RTMP/WebRTC/HLS/HTTP-FLV/SRT.
Note: The single node architecture for SRS, general and major use scenario, please see figma.
Note: The cluster architecture, for detail picture please see here
To learn the basics of SRS, you may choose one of the following favorite methods.
Get SRS source, recommend CentOS7:
git clone -b 4.0release https://gitee.com/ossrs/srs.git
Build SRS in srs/trunk
:
cd srs/trunk
./configure
make
Run SRS server:
./objs/srs -c conf/srs.conf
Check SRS by http://localhost:8080/ or:
# Check the process status
./etc/init.d/srs status
# Check the SRS logs
tail -n 30 -f ./objs/srs.log
Publish stream by FFmpeg or OBS :
ffmpeg -re -i ./doc/source.flv -c copy -f flv rtmp://localhost/live/livestream
Or use docker of FFmpeg to publish, please replace the 192.168.1.10
by your IP:
docker run --rm ossrs/srs:encoder \
ffmpeg -re -i ./doc/source.200kbps.768x320.flv -c copy -f flv rtmp://192.168.1.10/live/livestream
Play stream by:
- RTMP (by VLC): rtmp://localhost/live/livestream
- H5(HTTP-FLV): http://localhost:8080/live/livestream.flv
- H5(HLS): http://localhost:8080/live/livestream.m3u8
Note that if convert RTMP to WebRTC, please use rtmp2rtc.conf
:
- H5(WebRTC): webrtc://localhost/live/livestream
Note: Please set CANDIDATE if need to enable WebRTC, please read CANDIDATE。
Note: If need HTTPS, by which WebRTC and modern browsers require, please read HTTPS API and HTTPS Callback and HTTPS Live Streaming, however HTTPS proxy also works perfect with SRS such as Nginx.
Please read more information about SRS.
Run SRS docker, the available images is here :
docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 \
ossrs/srs:4 ./objs/srs -c conf/docker.conf
If need to enable WebRTC, please set the CANDIDATE and expose UDP/8000 :
docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 \
--env CANDIDATE="192.168.1.10" -p 8000:8000/udp \
ossrs/srs:4 ./objs/srs -c conf/docker.conf
For HTTPS, please map the HTTPS ports, and use configs like conf/https.*
, for example, conf/https.docker.conf
:
CANDIDATE="192.168.1.10"
docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 -p 1990:1990 -p 8088:8088 \
--env CANDIDATE=$CANDIDATE -p 8000:8000/udp \
ossrs/srs:4 ./objs/srs -c conf/https.docker.conf
Note: About CANDIDATE, please read CANDIDATE
Note: If convert RTMP to WebRTC, please use
rtmp2rtc.conf
Remark: Please use your HTTPS key and cert file, please read HTTPS API and HTTPS Callback and HTTPS Live Streaming, however HTTPS proxy also works perfect with SRS such as Nginx.
Publish stream by FFmpeg or OBS :
ffmpeg -re -i ./doc/source.flv -c copy -f flv rtmp://localhost/live/livestream
Or use docker of FFmpeg to publish, please replace the 192.168.1.10
by your IP:
docker run --rm ossrs/srs:encoder \
ffmpeg -re -i ./doc/source.200kbps.768x320.flv -c copy -f flv rtmp://192.168.1.10/live/livestream
Play stream by:
- RTMP (by VLC): rtmp://localhost/live/livestream
- H5(HTTP-FLV): http://localhost:8080/live/livestream.flv
- H5(HLS): http://localhost:8080/live/livestream.m3u8
Please read more information about SRS.
SRS works well on Cloud Virtual Machine:
- DigitalOcean Droplet: Create SRS Droplet.
- TencentCloud LightHouse: Deploy SRS to Tencent LightHouse.
- TencentCloud CVM: Deploy SRS to Tencent CVM.
- Binary installer for CentOS 7, download and install SRS, use systemctl to manage the service.
Highly recommend that you Deploy to Cloud Platforms.
SRS provides a set of template repository for fast deploy:
- General K8s
- EKS(Amazon Elastic Kubernetes Service)
- AKS(Azure Kubernetes Service)
- TKE(Tencent Kubernetes Engine)
- ACK(Alibaba Cloud Container Service for Kubernetes)
Please read more information about SRS.
SRS is industrial-strength live streaming cluster, for the best conceptual integrity and the simplest implementation. SRS provides variety of inputs, for example, Push RTMP to SRS, Push RTSP/UDP/FLV to SRS, Pull Stream to SRS. SRS can transform the RTMP to other protocols or deliveries, for example, RTMP Transcode, Snapshot, Forward to Other Servers, Transmux to HTTP-FLV, Transmux to HLS, Transmux to HDS, Transmux SRT, DVR to FLV/MP4. SRS canbe used in CDN for large stream clusters, for example, RTMP Cluster、 OriginCluster, VHOST, Reload, HTTP-FLV Cluster. Futhermore, SRS provides apis, for example, HTTP Callback, Security, HTTP API. There're lots of Applications in both CDN and origin servers.
Note: Please read https://www.processon.com/view/link/619f25c37d9c083e98adb37e for details.
Note: Use K8S to deploy Edge Cluster和Origin Cluster。
Deployment Guides:
We illustrate and explain how to deploy SRS for typical use scenarios.
- Delivery RTMP: How to delivery RTMP using SRS.
- Delivery HLS: How to delivery RTMP and HLS using SRS.
- Delivery HTTP FLV: How to remux RTMP to HTTP FLV stream.
- Delivery HDS: How to delivery HDS using SRS.
- Delivery DASH: How to delivery DASH using SRS.
- Transmux SRT: How to transmux SRT to live streaming.
- Transcode: How to transcode the RTMP stream.
- Snapshot: How to snapshot thumbnail of RTMP stream.
- Forward: How to forward RTMP to other servers.
- Low latency: How to deploy the low latency SRS.
- Ingest: How to ingest other streams to SRS.
- HTTP Server: How to deploy SRS as HTTP server.
- SRS DEMO: How to deploy the demo of SRS.
- Projects: Who are using SRS.
- Setup: How to setup SRS.
- WebRTC Play: Play stream by WebRTC.
- GB28181 Publish: Publish stream by GB28181.
- SRT Publish: Publish stream by SRT.
- HEVC/H.265: Supports H.265 codec.
Cluster Guides:
The examples here are aimed for deploying and maintaining origin/edge cluster.
- K8s: Use ACK(AlibabaCloud Container Service for Kubernetes) to build your SRS cluster.
- Origin Cluster: Origin Cluster for huge streams or fault tolerance.
- Edge Cluster: RTMP: Edge Cluster for RTMP streaming.
- Edge Cluster: FLV: Edge Cluster for HTTP-FLV streaming.
- Edge Cluster: HLS: Edge Cluster for HLS streaming.
- VHOST: Support multiple customers in the same cluster by vhost.
- Reload: Apply changed config by reload.
- Tracable Log: Debug and trace user in cluster log.
- Log Rotate: How to rotate the log.
Integration Guides:
- Linux Service: Start or stop SRS as service.
- HTTP Callback: Use HTTP callback to hook the events of SRS.
- HTTP API: Get system data from HTTP API of SRS.
- Special Control: Some special control config for expert.
Develop Guide
- SRS Code Analysis, code and arch.
- ST coroutine analysis, the base of SRS.
- High concurrency network server arch, the design of ST/SRS.
- Third-party Client SDK: For mobile platform, such as Android and iOS, there are some client SDKs to publish or play live stream.
Migrate From NGINX-RTMP:
If you are a user of nginx-rtmp, there is a tendency to use SRS as nginx-rtmp that you already know. Be aware of this bias and try to avoid it.
- NG EXEC: Fork/Exec external program when got some event.
User Guides:
- Quick Start: A quick introduction of SRS, please start here.
- Milestones: The milestone and product design。
- Why SRS: Why you should choose SRS? What's the roadmap?
- GIT Mirrors: The GIT mirrors of SRS to get SRS faster.
- Main Features: The features list of SRS. Some features is introduced from specified version; while some features are experiment.
- Releases: The released versions of SRS.
- Docs: The detail tech docs of SRS.
- Compare: The comparation of SRS to other servers.
- Performance: The performance benchmark.
Join Us:
- How to file a issue to SRS?
- File Issue: File an issue.
- Contact: Contact us by DingTalk or Wechat.
For any help, contact us.
Winlin 2020.01
Welcome to SRS wiki!
Please select your language:
Please select your language:
Please select your language:
Please select your language:
Please select your language: