Skip to content

Commit

Permalink
Merge branch 'srt' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 24, 2020
2 parents 65e8835 + b7855d1 commit 19df3c7
Show file tree
Hide file tree
Showing 29 changed files with 3,120 additions and 102 deletions.
95 changes: 50 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,23 @@ docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 ossrs/srs:3
**From here,** strongly recommend to read bellow wikis:

* Usage: How to delivery RTMP?([CN][v1_CN_SampleRTMP], [EN][v1_EN_SampleRTMP])
* Usage: How to delivery RTMP Edge Cluster?([CN][v3_CN_SampleRTMPCluster], [EN][v3_EN_SampleRTMPCluster])
* Usage: How to create a RTMP Origin Cluster?([CN][v3_CN_SampleOriginCluster], [EN][v3_EN_SampleOriginCluster])
* Usage: How to delivery HTTP FLV Live Streaming?([CN][v3_CN_SampleHttpFlv], [EN][v3_EN_SampleHttpFlv])
* Usage: How to delivery HTTP FLV Live Streaming Cluster?([CN][v3_CN_SampleHttpFlvCluster], [EN][v3_EN_SampleHttpFlvCluster])
* Usage: How to delivery RTMP-Edge Cluster?([CN][v3_CN_SampleRTMPCluster], [EN][v3_EN_SampleRTMPCluster])
* Usage: How to create a RTMP-Origin Cluster?([CN][v3_CN_SampleOriginCluster], [EN][v3_EN_SampleOriginCluster])
* Usage: How to delivery HTTP-FLV?([CN][v3_CN_SampleHttpFlv], [EN][v3_EN_SampleHttpFlv])
* Usage: How to delivery HTTP-FLV Cluster?([CN][v3_CN_SampleHttpFlvCluster], [EN][v3_EN_SampleHttpFlvCluster])
* Usage: How to delivery HLS?([CN][v3_CN_SampleHLS], [EN][v3_EN_SampleHLS])
* Usage: How to delivery HLS for other codec?([CN][v3_CN_SampleTranscode2HLS], [EN][v3_EN_SampleTranscode2HLS])
* Usage: How to transode RTMP stream by FFMPEG?([CN][v2_CN_SampleFFMPEG], [EN][v2_EN_SampleFFMPEG])
* Usage: How to transcode to h.264+aac for HLS?([CN][v3_CN_SampleTranscode2HLS], [EN][v3_EN_SampleTranscode2HLS])
* Usage: How to transode stream by FFMPEG?([CN][v2_CN_SampleFFMPEG], [EN][v2_EN_SampleFFMPEG])
* Usage: How to forward stream to other servers?([CN][v3_CN_SampleForward], [EN][v3_EN_SampleForward])
* Usage: How to deploy in low lantency mode?([CN][v3_CN_SampleRealtime], [EN][v3_EN_SampleRealtime])
* Usage: How to ingest file/stream/device to RTMP?([CN][v1_CN_SampleIngest], [EN][v1_EN_SampleIngest])
* Usage: How to enable low lantency live streaming?([CN][v3_CN_SampleRealtime], [EN][v3_EN_SampleRealtime])
* Usage: How to ingest file/stream/device to SRS?([CN][v1_CN_SampleIngest], [EN][v1_EN_SampleIngest])
* Usage: How to delivery HLS by SRS HTTP server?([CN][v3_CN_SampleHTTP], [EN][v3_EN_SampleHTTP])
* Usage: How to delivery DASH(Experimental)?([CN][v3_CN_SampleDASH], [EN][v3_EN_SampleDASH])
* Usage: How to transmux SRT(Experimental) to live streaming?([CN][v4_CN_SampleSRT], [EN][v4_EN_SampleSRT])
* Usage: How to publish h.264 raw stream as RTMP? ([CN][v3_CN_SrsLibrtmp2], [EN][v3_EN_SrsLibrtmp2])
* Usage: How to improve edge performance by multiple CPUs? ([CN][v3_CN_REUSEPORT], [EN][v3_EN_REUSEPORT])
* Usage: Why choose SRS? About the milestone and product plan? ([CN][v1_CN_Product], [EN][v1_EN_Product])
* Usage: How to file bug or chat with us? ([CN][v1_CN_Contact], [EN][v1_EN_Contact])
* Usage: How to enable multiple processes? ([CN][v3_CN_REUSEPORT], [EN][v3_EN_REUSEPORT])
* Usage: Why SRS? What's the milestones? ([CN][v1_CN_Product], [EN][v1_EN_Product])
* Usage: Want to contact us? ([CN][v1_CN_Contact], [EN][v1_EN_Contact]) Or file an issue [here](https://github.com/ossrs/srs/issues/new)?

<a name="srs-30-wiki"></a>
## Wiki
Expand Down Expand Up @@ -127,6 +129,7 @@ For previous versions, please read:
- [x] [Experimental] Support a simple [mgmt console][console], please read [srs-ngb][srs-ngb].
- [x] [Experimental] Support RTMP client library: srs-librtmp([CN][v3_CN_SrsLibrtmp], [EN][v3_EN_SrsLibrtmp])
- [x] [Experimental] Support HTTP RAW API, please read [#459][bug #459], [#470][bug #470], [#319][bug #319].
- [x] [Experimental] Support SRT server, read [#1147][bug #1147].
- [x] [Deprecated] Support Adobe HDS(f4m), please read wiki([CN][v2_CN_DeliveryHDS], [EN][v2_EN_DeliveryHDS]) and [#1535][bug #1535].
- [x] [Deprecated] Support bandwidth testing([CN][v1_CN_BandwidthTestTool], [EN][v1_EN_BandwidthTestTool]), please read [#1535][bug #1535].
- [x] [Deprecated] Support Adobe FMS/AMS token traverse([CN][v3_CN_DRM2], [EN][v3_EN_DRM2]) authentication, please read [#1535][bug #1535].
Expand Down Expand Up @@ -1002,13 +1005,13 @@ SRS always use the simplest architecture to solve complex domain problems.
## Modularity Architecture

```
+------------------------------------------------------+
| SRS server | Programs in Main or Research |
+------------------------------------------------------+
| App(For SRS) | Modules(1) | research/librtmp |
+------------------------------------------------------+
| Service(C/S apps over ST) | Libs(Export librtmp) |
+------------------------------------------------------+
+----------------+-------------------------------------+
| SRS/SRT server | Programs in Main or Research |
+----------------+--+------------+---------------------+
| App(For SRS) | Modules(1) | research/librtmp |
+-------------------+------------+---------------------+
| Service(C/S apps over ST) | srs-librtmp |
+--------------------------------+---------------------+
| Protocol Stack(RTMP/HTTP/RTSP/JSON/AMF/Format) |
+------------------------------------------------------+
| Kernel(File, Codec, Stream, LB services) |
Expand All @@ -1027,31 +1030,33 @@ Remark:
+---------+ +----------+
| Publish | | Deliver |
+---|-----+ +----|-----+
+----------------------+-------------------------+----------------+
| Input | SRS(Simple RTMP Server) | Output |
+----------------------+-------------------------+----------------+
| | +-> DASH -------------+-> DASH player |
| Encoder(1) | +-> RTMP/HDS --------+-> Flash player |
| (FMLE,FFMPEG, -rtmp-+->-+-> HLS/HTTP ---------+-> M3U8 player |
| Flash,XSPLIT, | +-> FLV/MP3/Aac/Ts ---+-> HTTP player |
| ......) | +-> Fowarder ---------+-> RTMP server |
| | +-> Transcoder -------+-> RTMP server |
| | +-> EXEC(5) ----------+-> External app |
| | +-> DVR --------------+-> FLV file |
| | +-> BandwidthTest ----+-> Flash |
+----------------------+ | |
| MediaSource(2) | | |
| (RTSP,FILE, | | |
| HTTP,HLS, --pull-+->-- Ingester(3) -(rtmp)-+-> SRS |
| Device, | | |
| ......) | | |
+----------------------+ | |
| MediaSource(2) | | |
| (RTSP,FILE, | | |
| HTTP,HLS, --push-+->-- Streamer(4) -(rtmp)-+-> SRS |
| Device, | | |
| ......) | | |
+----------------------+-------------------------+----------------+
+----------------------+----------------------------+----------------+
| Input | SRS(Simple RTMP Server) | Output |
+----------------------+----------------------------+----------------+
| | +-> DASH ----------------+-> DASH player |
| Encoder(1) | +-> RTMP/HDS -----------+-> Flash player |
| (FMLE,FFMPEG, -rtmp-+->-+-> HLS/HTTP ------------+-> M3U8 player |
| Flash,XSPLIT, | +-> FLV/MP3/Aac/Ts ------+-> HTTP player |
| ......) | +-> Fowarder ------------+-> RTMP server |
| | +-> Transcoder ----------+-> RTMP server |
| | +-> EXEC(5) -------------+-> External app |
| | +-> DVR -----------------+-> FLV file |
| | +-> BandwidthTest -------+-> Flash |
+----------------------+ | |
| MediaSource(2) | | |
| (RTSP,FILE, | | |
| HTTP,HLS, --pull-+->-- Ingester(3) -(rtmp)----+-> SRS |
| Device, | | |
| ......) | | |
+----------------------+ | |
| MediaSource(2) | | |
| (RTSP,FILE, | | |
| HTTP,HLS, --push-+->- StreamCaster(4) -(rtmp)-+-> SRS |
| Device, | | |
| ......) | | |
+----------------------+ | |
| FFMPEG --push(srt)--+->- SRTModule(5) ---(rtmp)-+-> SRS |
+----------------------+----------------------------+----------------+
```

Expand All @@ -1062,6 +1067,7 @@ Remark:
1. Ingester: Forks a ffmpeg(or other tools) to ingest as rtmp to SRS, please read [Ingest][v1_CN_Ingest].
1. Streamer: Remuxs other protocols to RTMP, please read [Streamer][v2_CN_Streamer].
1. EXEC: Like NGINX-RTMP, EXEC forks external tools for events, please read [ng-exec][v3_CN_NgExec].
1. SRTModule: A isolate module which run in [hybrid](https://github.com/ossrs/srs/issues/1147#issuecomment-577574883) model.

## AUTHORS

Expand Down Expand Up @@ -1611,10 +1617,9 @@ Winlin
[bug #1580]: https://github.com/ossrs/srs/issues/1580
[bug #1547]: https://github.com/ossrs/srs/issues/1547
[bug #1221]: https://github.com/ossrs/srs/issues/1221
[bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx

[bug #1111]: https://github.com/ossrs/srs/issues/1111
[bug #463]: https://github.com/ossrs/srs/issues/463
[bug #1147]: https://github.com/ossrs/srs/issues/1147
[bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx

[exo #828]: https://github.com/google/ExoPlayer/pull/828
Expand Down
6 changes: 6 additions & 0 deletions trunk/auto/auto_headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ else
srs_undefine_macro "SRS_AUTO_HDS" $SRS_AUTO_HEADERS_H
fi

if [ $SRS_SRT = YES ]; then
srs_define_macro "SRS_AUTO_SRT" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_AUTO_SRT" $SRS_AUTO_HEADERS_H
fi

if [ $SRS_MEM_WATCH = YES ]; then
srs_define_macro "SRS_AUTO_MEM_WATCH" $SRS_AUTO_HEADERS_H
else
Expand Down
16 changes: 16 additions & 0 deletions trunk/auto/depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,22 @@ if [ $SRS_FFMPEG_TOOL = YES ]; then
if [ ! -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]; then echo "build ffmpeg-4.1 failed."; exit -1; fi
fi

#####################################################################################
# SRT module, https://github.com/ossrs/srs/issues/1147#issuecomment-577469119
#####################################################################################
if [[ $SRS_SRT == YES ]]; then
if [[ -f /usr/local/lib64/libsrt.a && ! -f ${SRS_OBJS}/srt/lib/libsrt.a ]]; then
mkdir -p ${SRS_OBJS}/srt/lib && ln -sf /usr/local/lib64/libsrt.a ${SRS_OBJS}/srt/lib/libsrt.a
mkdir -p ${SRS_OBJS}/srt/include && ln -sf /usr/local/include/srt ${SRS_OBJS}/srt/include/
fi
if [[ -f ${SRS_OBJS}/srt/lib/libsrt.a ]]; then
echo "libsrt-1.4.1 is ok.";
else
echo "no libsrt, please use srs-docker or build from source https://github.com/ossrs/srs/issues/1147#issuecomment-577469119";
exit -1;
fi
fi

#####################################################################################
# build research code, librtmp
#####################################################################################
Expand Down
6 changes: 6 additions & 0 deletions trunk/auto/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ help=no
################################################################
# feature options
SRS_HDS=NO
SRS_SRT=NO
SRS_NGINX=NO
SRS_FFMPEG_TOOL=NO
SRS_LIBRTMP=NO
Expand Down Expand Up @@ -125,6 +126,7 @@ Features:
--with-librtmp Enable srs-librtmp, library for client.
--with-research Build the research tools.
--with-utest Build the utest for SRS.
--with-srt Build the srt for SRS.
--without-ssl Disable rtmp complex handshake.
--without-hds Disable hds, the adobe http dynamic streaming.
Expand All @@ -133,6 +135,7 @@ Features:
--without-librtmp Disable srs-librtmp, library for client.
--without-research Do not build the research tools.
--without-utest Do not build the utest for SRS.
--without-srt Do not build the srt for SRS.
--prefix=<path> The absolute installation path for srs. Default: $SRS_PREFIX
--static Whether add '-static' to link options.
Expand Down Expand Up @@ -211,6 +214,7 @@ function parse_user_option() {
--with-librtmp) SRS_LIBRTMP=YES ;;
--with-research) SRS_RESEARCH=YES ;;
--with-utest) SRS_UTEST=YES ;;
--with-srt) SRS_SRT=YES ;;
--with-gperf) SRS_GPERF=YES ;;
--with-gmc) SRS_GPERF_MC=YES ;;
--with-gmd) SRS_GPERF_MD=YES ;;
Expand All @@ -226,6 +230,7 @@ function parse_user_option() {
--without-librtmp) SRS_LIBRTMP=NO ;;
--without-research) SRS_RESEARCH=NO ;;
--without-utest) SRS_UTEST=NO ;;
--without-srt) SRS_SRT=NO ;;
--without-gperf) SRS_GPERF=NO ;;
--without-gmc) SRS_GPERF_MC=NO ;;
--without-gmd) SRS_GPERF_MD=NO ;;
Expand Down Expand Up @@ -522,6 +527,7 @@ SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
if [ $SRS_LIBRTMP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-librtmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-librtmp"; fi
if [ $SRS_RESEARCH = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-research"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-research"; fi
if [ $SRS_UTEST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-utest"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-utest"; fi
if [ $SRS_SRT = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-srt"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-srt"; fi
if [ $SRS_GPERF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gperf"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gperf"; fi
if [ $SRS_GPERF_MC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmc"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmc"; fi
if [ $SRS_GPERF_MD = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmd"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmd"; fi
Expand Down
2 changes: 1 addition & 1 deletion trunk/auto/utest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ USER_DIR = .
CPPFLAGS += -I\$(GTEST_DIR)/include
# Flags passed to the C++ compiler.
CXXFLAGS += -g -Wall -Wextra -O0 ${EXTRA_DEFINES}
CXXFLAGS += ${CXXFLAGS} -Wextra ${EXTRA_DEFINES}
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.
Expand Down
12 changes: 12 additions & 0 deletions trunk/conf/full.conf
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,18 @@ stream_caster {
listen 8936;
}

#############################################################################################
# SRT server section
#############################################################################################
# @doc https://github.com/ossrs/srs/issues/1147#issuecomment-577607026
srt_server {
# whether SRT server is enabled.
# default: off
enabled on;
# The UDP listen port for SRT.
listen 10080;
}

#############################################################################################
# Kafka sections
#############################################################################################
Expand Down
32 changes: 32 additions & 0 deletions trunk/conf/srt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SRT config.

listen 1935;
max_connections 1000;
srs_log_tank console;
daemon off;

http_api {
enabled on;
listen 1985;
}
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}

srt_server {
enabled on;
listen 10080;
}

# @doc https://github.com/ossrs/srs/issues/1147#issuecomment-577607026
vhost __defaultVhost__ {
}
vhost srs.srt.com.cn {
}

stats {
network 0;
disk sda sdb xvda xvdb;
}
Loading

0 comments on commit 19df3c7

Please sign in to comment.