Code Monkey home page Code Monkey logo

ossrs / srs Goto Github PK

View Code? Open in Web Editor NEW
24.2K 847.0 5.2K 247.48 MB

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.

Home Page: https://ossrs.io

License: MIT License

Shell 2.33% CMake 0.06% Python 0.19% HTML 3.38% C++ 87.47% Makefile 0.03% JavaScript 5.76% Go 0.59% CSS 0.01% Dockerfile 0.03% Lua 0.04% Batchfile 0.01% NSIS 0.09%
rtmp live-streaming live media-server hls webrtc srt low-latency video-conferencing video

srs's Introduction

SRS(Simple Realtime Server)

SRS/6.0 (Hang) is a simple, high-efficiency, and real-time video server, supporting RTMP/WebRTC/HLS/HTTP-FLV/SRT/MPEG-DASH/GB28181, Linux/Windows/macOS, X86_64/ARMv7/AARCH64/M1/RISCV/LOONGARCH/MIPS, and essential features.

SRS Overview

Note: For more details on the single-node architecture for SRS, please visit the following link.

SRS is licenced under MIT, and some third-party libraries are distributed under their licenses.

Usage

Please check the Getting Started guide in English or Chinese. We highly recommend using SRS with docker:

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

Tips: If you're in China, use this image registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5 for faster speed.

Open http://localhost:8080/ to verify, and then stream using the following FFmpeg command:

ffmpeg -re -i ./doc/source.flv -c copy -f flv -y rtmp://localhost/live/livestream

Alternatively, stream by OBS using the following configuration:

  • Service: Custom
  • Server: rtmp://localhost/live
  • Stream Key: livestream

Play the following streams using media players:

If you'd like to use WebRTC, convert RTMP to WebRTC, or convert WebRTC to RTMP, please check out the wiki documentation in either English or Chinese.

To learn more about RTMP, HLS, HTTP-FLV, SRT, MPEG-DASH, WebRTC protocols, clustering, HTTP API, DVR, and transcoding, please check the documents in English or Chinese.

Sponsor

Would you like additional assistance from us? By becoming a sponsor or backer of SRS, we can provide you with the support you need:

  • Backer: $5 per month, online text chat support through Discord.
  • Sponsor: $100 per month, online text chat plus online meeting support.

Please visit OpenCollective to become a backer or sponsor, and send us a direct message on Discord. We are currently providing support to the developers listed below:

At SRS, our goal is to create a free, open-source community that helps developers all over the world build high-quality streaming and RTC platforms for their businesses.

Contributing

The authors, TOC(Technical Oversight Committee), and contributors are listed here. The TOC members who made significant contributions and maintained parts of SRS are listed below:

  • Winlin: Founder of the project, focusing on ST and Issues/PR. Responsible for architecture and maintenance.
  • ZhaoWenjie: One of the earliest contributors, focusing on HDS and Windows. Has expertise in client technology.
  • ShiWei: Specializes in SRT and H.265, maintaining SRT and FLV patches for FFmpeg. An expert in codecs and FFmpeg.
  • XiaoZhihong: Concentrates on WebRTC/QUIC and SRT, with expertise in network QoS. Contributed to ARM on ST and was the original contributor for WebRTC.
  • WuPengqiang: Focused on H.265, initially contributed to the FFmpeg module in SRS for transcoding AAC with OPUS for WebRTC.
  • XiaLixin: Specializes in GB28181, with expertise in live streaming and WebRTC.
  • LiPeng: Concentrates on WebRTC and contributes to memory management and smart pointers.
  • ChenGuanghua: Focused on WebRTC/QoS and introduced the Asan toolchain to SRS.
  • ChenHaibo: Specializes in GB28181 and HTTP API, contributing to patches for FFmpeg with WHIP.
  • ZhangJunqin: Focused on H.265, Prometheus Exporter, and API module.

A huge THANK YOU goes out to:

We're really thankful to everyone in the community for helping us find bugs and improve the project. To stay in touch and keep helping our community, please check out this guide.

LICENSE

FOSSA Status

SRS is licenced under MIT, and some third-party libraries are distributed under their licenses.

Releases

  • 2024-02-15, Release v6.0-d4, v6.0-d4, 6.0 dev4, v6.0.113, 167695 lines.
  • 2023-11-19, Release v6.0-d3, v6.0-d3, 6.0 dev3, v6.0.101, 167560 lines.
  • 2023-09-28, Release v6.0-d2, v6.0-d2, 6.0 dev2, v6.0.85, 167509 lines.
  • 2023-08-31, Release v6.0-d1, v6.0-d1, 6.0 dev1, v6.0.72, 167135 lines.
  • 2023-07-09, Release v6.0-d0, v6.0-d0, 6.0 dev0, v6.0.59, 166739 lines.
  • 2024-04-03, Release v5.0-r2, v5.0-r2, 5.0 release2, v5.0.210, 163515 lines.
  • 2024-02-15, Release v5.0-r1, v5.0-r1, 5.0 release1, v5.0.208, 163441 lines.
  • 2023-12-30, Release v5.0-r0, v5.0-r0, 5.0 release0, v5.0.205, 163363 lines.
  • 2023-11-19, Release v5.0-b7, v5.0-b7, 5.0 beta7, v5.0.200, 163305 lines.
  • 2023-10-25, Release v5.0-b6, v5.0-b6, 5.0 beta6, v5.0.195, 163303 lines.
  • 2023-09-28, Release v5.0-b5, v5.0-b5, 5.0 beta5, v5.0.185, 163254 lines.
  • 2023-08-31, Release v5.0-b4, v5.0-b4, 5.0 beta4, v5.0.176, 162919 lines.
  • 2023-08-02, Release v5.0-b3, v5.0-b3, 5.0 beta3, v5.0.170, 162704 lines.
  • 2023-07-09, Release v5.0-b2, v5.0-b2, 5.0 beta2, v5.0.166, 162520 lines.
  • 2023-06-11, Release v5.0-b1, v5.0-b1, 5.0 beta1, v5.0.157, 162494 lines.
  • 2023-05-14, Release v5.0-b0, v5.0-b0, 5.0 beta0, v5.0.155, 162600 lines.
  • 2023-03-23, Release v5.0-a5, v5.0-a5, 5.0 alpha5, v5.0.148, 162066 lines.
  • 2023-02-12, Release v5.0-a4, v5.0-a4, 5.0 alpha4, v5.0.141, 161897 lines.
  • 2023-01-02, Release v5.0-a3, v5.0-a3, 5.0 alpha3, v5.0.128, 161327 lines.
  • 2022-12-18, Release v5.0-a2, v5.0-a2, 5.0 alpha2, v5.0.112, 161233 lines.
  • 2022-12-01, Release v5.0-a1, v5.0-a1, 5.0 alpha1, v5.0.100, 160817 lines.
  • 2022-11-25, Release v5.0-a0, v5.0-a0, 5.0 alpha0, v5.0.98, 159813 lines.
  • 2022-11-22, Release v4.0-r4, v4.0-r4, 4.0 release4, v4.0.268, 145482 lines.
  • 2022-09-16, Release v4.0-r3, v4.0-r3, 4.0 release3, v4.0.265, 145328 lines.
  • 2022-08-24, Release v4.0-r2, v4.0-r2, 4.0 release2, v4.0.257, 144890 lines.
  • 2022-06-29, Release v4.0-r1, v4.0-r1, 4.0 release1, v4.0.253, 144680 lines.
  • 2022-06-11, Release v4.0-r0, v4.0-r0, 4.0 release0, v4.0.252, 144680 lines.
  • 2020-06-27, Release v3.0-r0, 3.0 release0, 3.0.141, 122674 lines.
  • 2020-02-02, Release v3.0-b0, 3.0 beta0, 3.0.112, 121709 lines.
  • 2019-10-04, Release v3.0-a0, 3.0 alpha0, 3.0.56, 107946 lines.
  • 2017-03-03, Release v2.0-r0, 2.0 release0, 2.0.234, 86373 lines.
  • 2016-08-06, Release v2.0-b0, 2.0 beta0, 2.0.210, 89704 lines.
  • 2015-08-23, Release v2.0-a0, 2.0 alpha0, 2.0.185, 89022 lines.
  • 2014-12-05, Release v1.0-r0, all bug fixed, 1.0.10, 59391 lines.
  • 2014-10-09, Release v0.9.8, all bug fixed, 1.0.0, 59316 lines.
  • 2014-04-07, Release v0.9.1, live streaming. 30000 lines.
  • 2013-10-23, Release v0.1.0, rtmp. 8287 lines.
  • 2013-10-17, Created.

Features

Please read FEATURES.

Changelog

Please read CHANGELOG.

Performance

Please read PERFORMANCE.

Architecture

Please read ARCHITECTURE.

Ports

Please read PORTS.

APIs

Please read APIS.

Mirrors

Please read MIRRORS.

Dockers

Please read DOCKERS.

Beijing, 2013.10
Winlin

srs's People

Contributors

bluestn avatar callmenp avatar chandzhang avatar chen-guanghua avatar chundonglinlin avatar duiniuluantanqin avatar harlanc avatar huachao avatar hungmingwu avatar johzzy avatar lam2003 avatar lipeng19811218 avatar mapengfei53 avatar mingo-wu1 avatar panda1986 avatar pieerepi avatar rocfang avatar runner365 avatar snailtowardthesun avatar suzp1984 avatar t-bagwell avatar terrencetang2023 avatar wenjiegit avatar winlinvip avatar wrennywang avatar xialixin avatar xiaozhihong avatar yapingcat avatar zhengfl avatar zhouxiaojun2008 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

srs's Issues

MP3: Support mp3 for RTMP/HLS/HTTP-FLV/HTTP-TS/HLS etc.

SRS 3/4 supports MP3 over RTMP/HTTP-FLV/HTTP-TS, however there is some bugs need to be fixed.

Usage

Start SRS server:

# For RTMP/HTTP-FLV/HLS
./objs/srs -c conf/mp3.conf

# For HTTP-TS
./objs/srs -c conf/mp3.ts.conf

# For HTTP-MP3
./objs/srs -c conf/mp3.http.conf

# For RTMP(MP3) to WebRTC
./objs/srs -c conf/mp3.rtc.conf

Publish RTMP stream with mp3 audio:

ffmpeg -stream_loop -1  -re -i doc/source.flv -vcodec copy -acodec libmp3lame \
    -f flv rtmp://localhost/live/livestream

Play live stream:

  • RTMP by VLC or ffplay: rtmp://localhost/live/livestream
  • HTTP-FLV by VLC, ffplay or H5(srs-player): http://localhost:8080/live/livestream.flv
  • HTTP-MP3 by VLC, ffplay or H5(srs-player): http://localhost:8080/live/livestream.mp3
  • HTTP-TS by VLC, ffplay or H5(srs-player): http://localhost:8080/live/livestream.ts
  • HLS by VLC, ffplay or H5(srs-player): http://localhost:8080/live/livestream.m3u8
  • Covert RTMP(MP3) to WebRTC, play by H5(srs-player): webrtc://localhost/live/livestream

Status

I tested the ability for MP3 over serval protocols, found that some is ok but others fail, and listed the test result bellow.

  • Push RTMP stream with mp3 audio. SRS 4.0+
  • Play RTMP stream with mp3 audio by VLC/ffplay. SRS 4.0+
  • Play HTTP-FLV stream with mp3 audio by VLC/ffplay/H5(srs-player). SRS 4.0+
  • Play HTTP-MP3 stream with mp3 audio by VLC/ffplay/H5(srs-player). SRS 4.0+
  • #3334
  • #3337
  • #3338
  • #3339
  • #3340
  • DVR live stream to FLV file with MP3 audio. SRS4.0+
  • DVR live stream to MP4 file with MP3 audio. SRS4.0+
  • xqq/mpegts.js#83
  • Regresstion test for mp3 audio. SRS 5.0+ #3358
  • Play MPEG-DASH with MP3 audio. No plan.

Note: There is a bug for playing HTTP-TS with mp3 audio by H5, see mpegts.js #83

FRSC: Supports sub-millisecond latency, replaceable fast channel technology.

https://github.com/winlinvip/simple-rtmp-server/issues/120

Supports sub-100 millisecond latency, replaceable fast channel technology
Support <500ms latency, FRSC(fast RTMP-compatible stream channel tech)

Sub-100 millisecond latency requires improvement on the existing RTMP mechanism:

  1. Consider using UDP instead of TCP for encoder transmission, server internal communication, and client transmission. Support switchable UDP/TCP mechanism, for example, only the client uses TCP/RTMP while others use UDP private protocols.
  2. Consider non-interlaced media stream transmission: The encoder BLE supports non-interlaced output, where the audio stream timestamp increases monotonically, the video stream increases monotonically, but they are not mixed together. Mixing them would increase latency. The server does not mix them internally (interlaced) either, instead, the mixing of video and audio is done at the edge server or on the client side (own client).
  3. Consider using IO mechanism instead of timeout mechanism: Currently, the server logic waits for 300 milliseconds for client control messages and then sends all pending packets together to the client. This introduces a delay of 300 milliseconds, which increases at each level (according to average probability). If the 300-millisecond timeout mechanism is replaced with an IO mechanism, i.e., the "write" event for packet transmission becomes an IO "read" event, it can wait for two file descriptors to determine whether there is a message from the client or a message to be written.
  4. Packet loss mechanism: Consider supporting packet loss at the edge or in the encoder to control the delay within the sub-500 millisecond range, ideally around 300 milliseconds for Flash clients. If the server controls the delay within 200 milliseconds, the overall system delay can be controlled within 500 milliseconds. If the client is a custom client, the delay can be even lower (server-side control within 200 milliseconds).
  5. Rollback to standard mechanism: Support standard RTMP, for example, within the encoder/server cluster, use low-latency distribution mechanism. If it is detected that the client is Flash-based, the edge should mix the video and audio streams and send them to the client with monotonically increasing timestamps.

In summary, supporting sub-100 millisecond latency requires a comprehensive set of mechanisms and customization on top of RTMP. Compatibility with standard RTMP should also be considered. Therefore, the main goal of the system is to establish a fast channel, control the latency within the sub-100 millisecond range, and support integration with universal solutions at any point in the fast channel.

TRANS_BY_GPT3

Can RTMP stream forwarding be specified through a URL?

Currently, the forwarding mode in circulation needs to be configured through a configuration file. Can you please add the option to configure the forwarding URL?

For example:
Forwarding URL: rtmp://192.168.1.2/myapp/mystream?forward=rtmp://cdn.com/myapp/mystream?XXXXXX

This would make it more convenient to change whether the stream needs to be forwarded at any time. Currently, we have a use case where most of the streams only need to be viewed within the local network and do not require internet access. However, sometimes certain playback sources need to be played on the internet. Configuring this forwarding through a config file is not very flexible.

Could you please add this functionality or suggest a way to achieve a similar effect? Alternatively, could you provide guidance on how I can quickly modify the code to achieve this functionality?

TRANS_BY_GPT3

WebRTC: Support WebRTC, for video meeting, SFU server, video converence.

WebRTC is now quite mature, with stable playback and the protocol already being an RFC. There are also quite a few corresponding open-source projects. However, I believe that WebRTC still lacks a high-performance, simple and easy-to-use server. I have analyzed the existing servers before and found various issues. SRS has a great opportunity to solve these problems.

See English or Chinese

Support RAW API, support read/write API, which means support calling the http API to modify configuration and reload.

!!! Attention, the RAW API has been disabled after version 4.0, please refer to #2653 for background information.

!!! RAW API is removed from SRS 4.0, please see #2653

Other than the ability to reload, all other RAW API capabilities have been removed.

Provide an HTTP API to modify the configuration file and then reload the effective configuration.
https://github.com/winlinvip/simple-rtmp-server/issues/319

TRANS_BY_GPT3

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.