Skip to content

Commit 469f6de

Browse files
authored
add v7 (#69)
1 parent ec49c16 commit 469f6de

File tree

182 files changed

+29498
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+29498
-1
lines changed

docusaurus.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ const config = {
4545
//lastVersion: versions[0],
4646
versions: {
4747
current: {
48-
label: `6.0 (Unstable) 🚧`,
48+
label: `7.0 (Unstable) 🚧`,
49+
path: 'v7',
50+
},
51+
'6.0': {
52+
label: '6.0 (Alpha) 🚀',
4953
path: 'v6',
5054
},
5155
'5.0': {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"sidebar.docsSidebar.category.Getting Started": {
3+
"message": "起步"
4+
},
5+
"sidebar.docsSidebar.category.Main Protocols": {
6+
"message": "核心协议"
7+
},
8+
"sidebar.docsSidebar.category.Main Features": {
9+
"message": "核心功能"
10+
},
11+
"sidebar.docsSidebar.category.OpenAPI": {
12+
"message": "开放接口"
13+
},
14+
"sidebar.docsSidebar.category.Clusters": {
15+
"message": "集群"
16+
},
17+
"sidebar.docsSidebar.category.DevOps": {
18+
"message": "运维"
19+
},
20+
"sidebar.docsSidebar.category.Advanced Guides": {
21+
"message": "高级指引"
22+
},
23+
"sidebar.docsSidebar.category.Others": {
24+
"message": "其他"
25+
}
26+
}
Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
---
2+
title: ARM and CrossBuild
3+
sidebar_label: ARM和交叉编译
4+
hide_title: false
5+
hide_table_of_contents: false
6+
---
7+
8+
# SRS for linux-arm
9+
10+
注意:一般情况下,直接在<code>ARM</code>下是可以编译SRS的,参考官网正常的编译方法就可以,不需要交叉编译。
11+
12+
!!! 注意,请先确认是否需要<code>交叉编译</code>,一般可以直接编译,除非极少数情况。
13+
14+
> 翁晓晶:看来很多人误解了交叉编译的意思了,异构平台编译才要,比如编译平台跟运行平台是异构的,才需要,都是同一个平台不需要。
15+
16+
> 翁晓晶:最常见的场景就是玩网络设备的,因为网络设备的u都很弱,编译很慢,所以才在pc上做交叉编译,因为pc的u是x86,网络设备的u基本上都是mips或者arm的低频率的,属于异构,x86的u编译速度明显快于它们,所以大家都在pc上做交叉编译,然后把结果拷贝进网络设备,这样编译速度快很多,当然你有时间也可以直接在网络设备上正常编译也是可以的,就是慢很多。
17+
18+
> 翁晓晶:我看到有个朋友提到arm的服务器比如鲲鹏,那就直接在arm的服务器上编译就好了,没必要再交叉编译了,arm服务器又不是网络设备,U编译个程序还是没问题的,不要走弯路了。
19+
20+
## Why run SRS on ARM?
21+
22+
ARM跑SRS主要原因:
23+
24+
* ARM服务器越来越多了,可以直接编译和运行SRS,参考 [#1282](https://github.com/ossrs/srs/issues/1282#issue-386077124)
25+
* ARM嵌入式设备上用SRS,会比较难,但可以交叉编译,参考 [#1547](https://github.com/ossrs/srs/issues/1547#issue-543780097)
26+
27+
## RaspberryPi
28+
29+
SRS可以直接在`RespberryPI`上编译和运行,不用交叉编译。参考 [#1282](https://github.com/ossrs/srs/issues/1282#issue-386077124)
30+
31+
<a name="armv8-and-aarch64"></a>
32+
33+
## ARM Server: armv7, armv8(aarch64)
34+
35+
SRS可以直接在ARM Server上编译和运行,不用交叉编译。参考 [#1282](https://github.com/ossrs/srs/issues/1282#issue-386077124)
36+
37+
```
38+
./configure && make
39+
```
40+
41+
如果想编译出arm的二进制,在arm服务器上运行,比如在mac上编译出二进制后放在鲲鹏服务器上跑,也可以用arm docker编译,参考[aarch64](https://github.com/ossrs/dev-docker/tree/aarch64#usage)
42+
43+
```
44+
docker run -it --rm -v `pwd`:/srs -w /srs ossrs/srs:aarch64 \
45+
bash -c "./configure && make"
46+
```
47+
48+
对于龙芯和鲲鹏等armv8平台,可能无法识别出来CPU,可以指定为armv8,参考[#1282](https://github.com/ossrs/srs/issues/1282#issuecomment-568891854)
49+
50+
```bash
51+
./configure --extra-flags='-D__aarch64__' && make
52+
```
53+
54+
直接运行SRS:
55+
56+
```
57+
./objs/srs -c conf/console.conf
58+
```
59+
60+
推流到这个docker:
61+
62+
```
63+
ffmpeg -re -i doc/source.flv -c copy -f flv rtmp://127.0.0.1:1935/live/livestream
64+
```
65+
66+
播放:[http://localhost:8080/live/livestream.flv](http://localhost:8080/players/srs_player.html?autostart=true&stream=livestream.flv&port=8080&schema=http)
67+
68+
![image](https://user-images.githubusercontent.com/2777660/72774670-7108c980-3c46-11ea-9e8b-d4fb3a475ea2.png)
69+
70+
<a name="ubuntu-cross-build-srs"></a>
71+
72+
## Ubuntu Cross Build SRS: ARMv8(aarch64)
73+
74+
!!! 注意,请先确认是否需要交叉编译,一般可以直接编译,除非极少数情况,参考[#1547](https://github.com/ossrs/srs/issues/1547#issue-543780097)
75+
76+
启动容器Ubuntu20(xenial),主目录为SRS:
77+
78+
```
79+
cd ~/git/srs/trunk
80+
docker run --rm -it -v `pwd`:/srs -w /srs \
81+
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:ubuntu20 bash
82+
```
83+
84+
> 推荐使用阿里云的容器,下载的速度比较快,也可以使用docker官方容器:`ossrs/srs:ubuntu20`
85+
86+
安装toolchain(容器已经安装好了):
87+
88+
```
89+
apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
90+
```
91+
92+
交叉编译SRS:
93+
94+
```
95+
./configure --cross-build --cross-prefix=aarch64-linux-gnu-
96+
make
97+
```
98+
99+
> 编译时,默认会重新交叉编译OpenSSL,而不会使用系统的SSL,如果需要强制使用系统的SSL,可以用`--use-sys-ssl`
100+
101+
> 若编译时无法识别出aarch64,可以在configure时加编译选项`--extra-flags='-D__aarch64__'`,一般没有这个问题。
102+
103+
在ARMv8(aarch64)的docker上跑SRS:https://hub.docker.com/r/arm64v8/ubuntu
104+
105+
```
106+
cd ~/git/srs/trunk && docker run --rm -it -v `pwd`:/srs -w /srs \
107+
-p 1935:1935 -p 1985:1985 -p 8080:8080 arm64v8/ubuntu \
108+
./objs/srs -c conf/console.conf
109+
```
110+
111+
推流到这个docker:
112+
113+
```
114+
ffmpeg -re -i doc/source.flv -c copy -f flv rtmp://127.0.0.1:1935/live/livestream
115+
```
116+
117+
播放:[http://localhost:8080/live/livestream.flv](http://localhost:8080/players/srs_player.html?autostart=true&stream=livestream.flv&port=8080&schema=http)
118+
119+
## Ubuntu Cross Build SRS: ARMv7
120+
121+
!!! 注意,请先确认是否需要交叉编译,一般可以直接编译,除非极少数情况,参考[#1547](https://github.com/ossrs/srs/issues/1547#issue-543780097)
122+
123+
启动容器Ubuntu20(xenial),主目录为SRS:
124+
125+
```
126+
cd ~/git/srs/trunk
127+
docker run --rm -it -v `pwd`:/srs -w /srs \
128+
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:ubuntu20 bash
129+
```
130+
131+
> 推荐使用阿里云的容器,下载的速度比较快,也可以使用docker官方容器:`ossrs/srs:ubuntu20`
132+
133+
安装toolchain(容器已经安装好了),例如[Acqua or RoadRunner board](https://www.acmesystems.it/arm9_toolchain)
134+
135+
```
136+
apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
137+
```
138+
139+
交叉编译SRS:
140+
141+
```
142+
./configure --cross-build --cross-prefix=arm-linux-gnueabihf-
143+
make
144+
```
145+
146+
> 编译时,默认会重新交叉编译OpenSSL,而不会使用系统的SSL,如果需要强制使用系统的SSL,可以用`--use-sys-ssl`
147+
148+
在ARMv7的docker上跑SRS:https://hub.docker.com/r/armv7/armhf-ubuntu
149+
150+
```
151+
cd ~/git/srs/trunk && docker run --rm -it -v `pwd`:/srs -w /srs \
152+
-p 1935:1935 -p 1985:1985 -p 8080:8080 armv7/armhf-ubuntu \
153+
./objs/srs -c conf/console.conf
154+
```
155+
156+
推流到这个docker:
157+
158+
```
159+
ffmpeg -re -i doc/source.flv -c copy -f flv rtmp://127.0.0.1:1935/live/livestream
160+
```
161+
162+
播放:[http://localhost:8080/live/livestream.flv](http://localhost:8080/players/srs_player.html?autostart=true&stream=livestream.flv&port=8080&schema=http)
163+
164+
## Ubuntu Cross Build SRS: ARMv7(hisiv500)
165+
166+
首先,找一台Ubuntu20的虚拟机,或者启动Docker:
167+
168+
```bash
169+
docker run --rm -it -v $(pwd):/srs -w /srs/trunk \
170+
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:ubuntu20 bash
171+
```
172+
173+
宿主机是64位的,而编译工具是32位的,所以需要安装一个工具:
174+
175+
```bash
176+
apt-get -y install lib32z1-dev
177+
```
178+
179+
然后,从[海思](https://www.hisilicon.com/)下载交叉编译工具,或者从网上找地方下载。解压后安装:
180+
181+
```bash
182+
chmod +x arm-hisiv500-linux.install
183+
./arm-hisiv500-linux.install
184+
source /etc/profile
185+
```
186+
187+
验证环境, 执行`which arm-hisiv500-linux-g++`能成功找到编译器,就安装成功了:
188+
189+
```bash
190+
which arm-hisiv500-linux-g++
191+
# /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/bin/arm-hisiv500-linux-g++
192+
```
193+
194+
编译SRS,命令如下:
195+
196+
```bash
197+
./configure --cross-build --cross-prefix=arm-hisiv500-linux-
198+
make
199+
```
200+
201+
在海思的板子启动SRS就可以了:
202+
203+
```bash
204+
./objs/srs -c conf/console.conf
205+
```
206+
207+
## Use Other Cross build tools
208+
209+
!!! 注意,请先确认是否需要交叉编译,一般可以直接编译,除非极少数情况,参考[#1547](https://github.com/ossrs/srs/issues/1547#issue-543780097)
210+
211+
SRS相关的参数如下:
212+
213+
```bash
214+
./configure -h
215+
216+
Presets:
217+
--cross-build Enable cross-build, please set bellow Toolchain also. Default: off
218+
219+
Cross Build options: @see https://ossrs.net/lts/zh-cn/docs/v6/doc/arm#ubuntu-cross-build-srs
220+
--cpu=<CPU> Toolchain: Select the minimum required CPU. For example: --cpu=24kc
221+
--arch=<ARCH> Toolchain: Select architecture. For example: --arch=aarch64
222+
--host=<BUILD> Toolchain: Build programs to run on HOST. For example: --host=aarch64-linux-gnu
223+
--cross-prefix=<PREFIX> Toolchain: Use PREFIX for tools. For example: --cross-prefix=aarch64-linux-gnu-
224+
225+
Toolchain options:
226+
--static=on|off Whether add '-static' to link options. Default: off
227+
--cc=<CC> Toolchain: Use c compiler CC. Default: gcc
228+
--cxx=<CXX> Toolchain: Use c++ compiler CXX. Default: g++
229+
--ar=<AR> Toolchain: Use archive tool AR. Default: g++
230+
--ld=<LD> Toolchain: Use linker tool LD. Default: g++
231+
--randlib=<RANDLIB> Toolchain: Use randlib tool RANDLIB. Default: g++
232+
--extra-flags=<EFLAGS> Set EFLAGS as CFLAGS and CXXFLAGS. Also passed to ST as EXTRA_CFLAGS.
233+
```
234+
235+
具体使用例子参考[这里](#ubuntu-cross-build-srs)
236+
237+
**--extra-flags**
238+
239+
之前在支持ARM时,新增过一个Flags的选项( https://github.com/ossrs/srs/issues/1282#issuecomment-568891854 ),会设置`CFLAGS and CXXFLAGS`,也会将这个设置传递到ST设置`EXTRA_CFLAGS`。同样,对于交叉编译,这个选项也是有效的。
240+
241+
Winlin 2014.2
242+
243+
![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.net&path=/lts/doc/zh/v6/arm)
244+
245+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: Client SDK
3+
sidebar_label: Client SDK
4+
hide_title: false
5+
hide_table_of_contents: false
6+
---
7+
8+
# Client SDK
9+
10+
整个直播的业务架构是:
11+
12+
```
13+
+---------+ +-----------------+ +---------+
14+
| Encoder +-->---+ SRS/CDN Network +--->---+ Player |
15+
+---------+ +-----------------+ +---------+
16+
```
17+
18+
## EXOPlayer
19+
20+
[EXOPlayer](https://github.com/google/ExoPlayer)是基于Android新的播放器框架的新播放器,支持众多的协议,包括HTTP-FLV和HLS。虽然不支持RTMP,但是支持FLV,因此延迟可以比HLS低很多。
21+
22+
## IJKPlayer
23+
24+
[ijkplayer](https://github.com/Bilibili/ijkplayer)[B站](http://www.bilibili.com/)出的一个播放器,基于FFMPEG软件解码,可以在Android和iOS上用。
25+
26+
## FFmpeg
27+
28+
[FFmpeg](https://ffmpeg.org) is a complete, cross-platform solution to record, convert and stream audio and video.
29+
30+
## WebRTC
31+
32+
[WebRTC](https://webrtc.org/) is Real-time communication for the web.
33+
34+
## LIBRTMP
35+
36+
[LIBRTMP](https://github.com/ossrs/librtmp)或者[SRS-LIBRTMP](https://github.com/ossrs/srs-librtmp),只是提供了Transport(RTMP)的功能,用于只需要做传输的场景,比如一些安防摄像头厂商,Transport之前是用RTSP/RTP做的,如果需要接入互联网,将流送到CDN给PC和移动端观看,直接使用H5或者Flash,不需要装插件时,可以用librtmp将已经编码的流MUX成FLV(RTMP传输实际上用的是FLV格式),然后通过librtmp发送出去。
37+
38+
## PC
39+
40+
有些应用场景,还是会用PC端推流,当然是用[OBS](https://obsproject.com/)
41+
42+
> 注意:OBS推流时,流名称的翻译有问题,**流名称**是要写在**流密钥**这里的,如下图所示。
43+
44+
![OBS](/img/doc-integration-client-sdk-001.png)
45+
46+
![OBS](/img/doc-integration-client-sdk-002.png)
47+
48+
Winlin 2017.4
49+
50+
![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.net&path=/lts/doc/zh/v6/client-sdk)
51+
52+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Cloud
3+
sidebar_label: 云服务
4+
hide_title: false
5+
hide_table_of_contents: false
6+
---
7+
8+
# Docker
9+
10+
迁移到了[Cloud](/cloud)
11+
12+
![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.net&path=/lts/doc/zh/v6/cloud)

0 commit comments

Comments
 (0)