Skip to content

Commit 7747c42

Browse files
应元东应元东
应元东
authored and
应元东
committed
Merge branch 'master' of https://github.com/yingDev/Web-Rtmp
2 parents a905924 + f21c871 commit 7747c42

File tree

2 files changed

+37
-16
lines changed

2 files changed

+37
-16
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
# Unix-style newlines with a newline ending every file
4+
[*]
5+
end_of_line = lf
6+
insert_final_newline = true
7+
8+
9+
# Matches multiple files with brace expansion notation
10+
# Set default charset
11+
[*.*]
12+
charset = utf-8
13+
indent_style = tab
14+
indent_size = 4
15+
trim_trailing_whitespace = true

README.md

+22-16
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
11
# Web-Rtmp
22
在网页上播放RTMP视频流,通过Websocket。
33

4-
# 基本原理
5-
- 服务端使用 [websockify](https://github.com/kanaka/websockify) 中转一个rtmp流。 ([yingDev的fork](https://github.com/yingDev/websockify) 去掉了base64子协议检查)
6-
```bash
7-
./websockify.py 1999 <rtmp_server>:1935
8-
```
9-
- 浏览器中使用 [node-rtmpapi](https://github.com/delian/node-rtmpapi) 解析 RTMP 协议,完成握手和通信。 ([yingDev的fork](https://github.com/yingDev/node-rtmpapi) 增加了浏览器支持、修正了几个错误)
10-
11-
- 提取其中的 H264 视频流
12-
13-
- 发送给 [Broadway](https://github.com/mbebenita/Broadway) 解码
14-
```js
4+
## 基本原理
5+
- 服务端
6+
- 使用 [websockify](https://github.com/kanaka/websockify) wrap 一个 rtmp 服务器地址。 ([yingDev的fork](https://github.com/yingDev/websockify) 去掉了base64子协议检查)
7+
8+
```bash
9+
./websockify.py 1999 <rtmp_server>:1935
10+
```
11+
- 浏览器
12+
- 使用 [node-rtmpapi](https://github.com/delian/node-rtmpapi) 解析 RTMP 协议,完成握手和通信。 ([yingDev的fork](https://github.com/yingDev/node-rtmpapi) 增加了浏览器支持、修正了几个错误)
13+
14+
- 提取其中的 H264 视频流
15+
16+
- 喂给 [Broadway](https://github.com/mbebenita/Broadway) 解码
17+
18+
```js
1519
decoder.decode(frame);
16-
```
20+
```
1721

18-
# 使用
22+
## 使用
1923
```js
24+
//比如 rtmp://helloworld.com/live/abc ---> app='live', streamName='abc', rtmp_server='helloworld.com'
25+
// ./websockify.py 1999 helloworld.com:1935
2026
var player = new WebRtmpPlayer('ws://127.0.0.1:1999', '<app>', '<streamName>', 'rtmp://<rtmp_server>/<app>');
2127
player.canvas.style['height'] = '100%';
2228
document.getElementById("vidCont").appendChild(player.canvas);
2329
```
2430

25-
# 运行
31+
## 运行
2632
```bash
2733
git clone https://github.com/yingDev/Web-Rtmp.git
2834
cd Web-Rtmp
@@ -42,12 +48,12 @@ webpack -w
4248
open index.html
4349
```
4450

45-
# 局限
51+
## 局限
4652
- Broadway:
4753
<blockquote> The decoder ...does not support weighted prediction for P-frames and CABAC entropy encoding...</blockquote>
4854

4955

50-
# 参考资料
56+
## 参考资料
5157
- Real-Time Messaging Protocol (RTMP) specification <br>
5258
http://www.adobe.com/devnet/rtmp.html
5359

0 commit comments

Comments
 (0)