8000 update http-flv/ts doc · kenser/pingostack.github.io@1dbb0ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 1dbb0ff

Browse files
committed
update http-flv/ts doc
1 parent 533dcd7 commit 1dbb0ff

File tree

2 files changed

+96
-12
lines changed

2 files changed

+96
-12
lines changed

docs/zh/2.3-config-flv.md

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ permalink: /docs/zh/config-flv
44
key: docs-2.3-config-flv--zh
55
---
66

7+
- [x] 兼容有无`.flv`后缀模式,如`http://live.pingos.io:8088/flv/ice` 等价于 `http://live.pingos.io:8088/flv/ice.flv`
8+
- [x] 动态挂载点模式,超简配置。
9+
10+
注意:
11+
对于http-flv协议,有些播放器要求必须以`.flv`后缀结尾才能正常播放,所以PingOS服务器兼容了有无`.flv`后缀的两种模式。
12+
{:.warning}
13+
714
## 配置
815

916
### flv_live
@@ -51,12 +58,51 @@ key: docs-2.3-config-flv--zh
5158
}
5259
```
5360
54-
## 测试
61+
##### 测试
62+
63+
1. live0
64+
- rtmp推流地址:`rtmp://ip/live0/stream-name`
65+
- http-flv播放地址:`http://ip/live0/stream-name` 和 `http://ip/flv0/stream-name`
66+
67+
2. live1
68+
- rtmp推流地址:`rtmp://ip/live1/stream-name`
69+
- http-flv播放地址:`http://ip/live1/stream-name` 和 `http://ip/flv1/stream-name`
70+
71+
72+
## 动态挂载点
73+
74+
在生产环境里,尤其是ToB的服务里,很可能需要非常多的application,比较笨的方法是我们在配置文件里一条条配置,这非常不利于管理和扩展。
75+
下面展示如何通过通配符,自动生成application,并且通过http-flv url参数指定挂载点名称。
76+
{:.info}
5577
56-
* rtmp推流地址:rtmp://ip/live0/stream-name
78+
### 配置模板
79+
80+
```nginx
81+
rtmp {
82+
server {
83+
listen 1935;
84+
application * {
85+
live on;
86+
}
87+
}
88+
}
89+
90+
http {
91+
server {
92+
listen 80;
93+
location flv {
94+
flv_live 1935;
95+
}
96+
}
97+
}
98+
```
5799
58-
> 对应的http-flv播放地址:http://ip/live0/stream-name 和 http://ip/flv0/stream-name
100+
`挂载点名称可以随意指定,此处依旧以live0、live1为例进行说明`{:.info}
101+
1. live0
102+
- rtmp推流地址:rtmp://ip/live0/stream-name
103+
- http-flv播放地址:http://ip/flv/stream-name?app=live0
59104
60-
* rtmp推流地址:rtmp://ip/live1/stream-name
105+
2. live1
106+
- rtmp推流地址:rtmp://ip/live1/stream-name
107+
- http-flv播放地址:http://ip/live1/stream-name?app=live1
61108
62-
> 对应的http-flv播放地址:http://ip/live1/stream-name 和 http://ip/flv1/stream-name

docs/zh/2.4-config-ts.md

Lines changed: 45 additions & 7 deletions
10000
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ key: docs-2.4-config-ts-zh
1717
`必须显示配置`{:.error}
1818

1919
* **For example**
20-
2120
```nginx
2221
rtmp {
2322
server {
@@ -50,11 +49,50 @@ key: docs-2.4-config-ts-zh
5049
}
5150
```
5251
53-
## 测试
54-
http-ts的配置方式和http-flv的配置原理完全相同。
52+
##### 测试
53+
54+
1. live0
55+
- rtmp推流地址:`rtmp://ip/live0/stream-name`
56+
- http-ts播放地址:`http://ip/live0/stream-name` 和 `http://ip/ts0/stream-name`
57+
58+
2. live1
59+
- rtmp推流地址:`rtmp://ip/live1/stream-name`
60+
- http-ts播放地址:`http://ip/live1/stream-name` 和 `http://ip/ts1/stream-name`
61+
62+
63+
## 动态挂载点
64+
65+
在生产环境里,尤其是ToB的服务里,很可能需要非常多的application,比较笨的方法是我们在配置文件里一条条配置,这非常不利于管理和扩展。
66+
下面展示如何通过通配符,自动生成application,并且通过http-ts url参数指定挂载点名称。
67+
{:.info}
68+
69+
### 配置模板
70+
71+
```nginx
72+
rtmp {
73+
server {
74+
listen 1935;
75+
application * {
76+
live on;
77+
}
78+
}
79+
}
80+
81+
http {
82+
server {
83+
listen 80;
84+
location ts {
85+
ts_live 1935;
86+
}
87+
}
88+
}
89+
```
5590
56-
* rtmp推流地址:rtmp://ip/live0/stream-name
57-
> 对应的http-ts播放地址:http://ip/live0/stream-name 和 http://ip/ts0/stream-name
91+
`挂载点名称可以随意指定,此处依旧以live0、live1为例进行说明`{:.info}
92+
1. live0
93+
- rtmp推流地址:rtmp://ip/live0/stream-name
94+
- http-ts播放地址:http://ip/ts/stream-name?app=live0
5895
59-
* rtmp推流地址:rtmp://ip/live1/stream-name
60-
> 对应的http-ts播放地址:http://ip/live1/stream-name 和 http://ip/ts1/stream-name
96+
2. live1< 3D12 /div>
97+
- rtmp推流地址:rtmp://ip/live1/stream-name
98+
- http-ts播放地址:http://ip/live1/stream-name?app=live1

0 commit comments

Comments
 (0)
0