File tree Expand file tree Collapse file tree 2 files changed +96
-12
lines changed Expand file tree Collapse file tree 2 files changed +96
-12
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,13 @@ permalink: /docs/zh/config-flv
4
4
key : docs-2.3-config-flv--zh
5
5
---
6
6
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
+
7
14
## 配置
8
15
9
16
### flv_live
@@ -51,12 +58,51 @@ key: docs-2.3-config-flv--zh
51
58
}
52
59
```
53
60
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}
55
77
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
+ ```
57
99
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
59
104
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
61
108
62
- > 对应的http-flv播放地址:http://ip/live1/stream-name 和 http://ip/flv1/stream-name
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ key: docs-2.4-config-ts-zh
17
17
` 必须显示配置 ` {:.error}
18
18
19
19
* ** For example**
20
-
21
20
``` nginx
22
21
rtmp {
23
22
server {
@@ -50,11 +49,50 @@ key: docs-2.4-config-ts-zh
50
49
}
51
50
```
52
51
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
+ ```
55
90
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
58
95
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
You can’t perform that action at this time.
0 commit comments