Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8bcb758

Browse files
committed
update README.md
1 parent 0e4587a commit 8bcb758

File tree

2 files changed

+152
-12
lines changed

2 files changed

+152
-12
lines changed

‎README.md‎

Lines changed: 150 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,45 @@
1-
# NGINX-based Media Streaming Server
1+
- [Pingos Media Streaming Server](#pingos-media-streaming-server)
2+
- [nginx-rtmp-module](#nginx-rtmp-module)
3+
- [项目博客](#项目博客)
4+
- [QQ交流群: 697773082](#qq交流群-697773082)
5+
- [服务器介绍](#服务器介绍)
6+
- [服务器功能](#服务器功能)
7+
- [我所做的改进](#我所做的改进)
8+
- [搭建流程](#搭建流程)
9+
- [编译过程](#编译过程)
10+
- [环境](#环境)
11+
- [安装依赖](#安装依赖)
12+
- [安装](#安装)
13+
- [配置文件](#配置文件)
14+
- [修改配置](#修改配置)
15+
- [配置模板(此配置能够满足单点服务)](#配置模板此配置能够满足单点服务)
16+
- [开启流监控页面](#开启流监控页面)
17+
- [启动nginx](#启动nginx)
18+
- [注意事项](#注意事项)
19+
- [推流](#推流)
20+
- [后台监控](#后台监控)
21+
- [全局配置](#全局配置)
22+
- [rtmp服务配置](#rtmp服务配置)
23+
- [http-flv配置](#http-flv配置)
24+
- [http-ts服务配置](#http-ts服务配置)
25+
- [hls服务配置](#hls服务配置)
26+
- [录像服务](#录像服务)
27+
- [http控制接口](#http控制接口)
28+
- [配置说明](#配置说明)
29+
- [控制接口说明](#控制接口说明)
30+
- [配置模板](#配置模板)
31+
32+
33+
# Pingos Media Streaming Server
234
## nginx-rtmp-module
335

436
### 项目博客
537

638
* https://blog.csdn.net/impingo
739

840
* http://pingos.me
9-
* QQ交流群:流媒体人的后院(697773082)
41+
42+
### QQ交流群: 697773082
1043

1144
# 服务器介绍
1245

@@ -257,15 +290,37 @@ rtmp推流地址:rtmp://ip/live1/stream-name
257290

258291
通过这个配置你可以实现自定义的location名字,无需跟application名保持一致。
259292
```nginx
293+
user root;
294+
daemon on;
295+
master_process on;
296+
worker_processes 1;
297+
#worker_rlimit 4g;
298+
#working_directory /usr/local/openresty/nginx/logs;
299+
300+
#error_log logs/error.log;
301+
#error_log logs/error.log notice;
302+
error_log logs/error.log info;
303+
304+
worker_rlimit_nofile 102400;
305+
worker_rlimit_core 2G;
306+
working_directory /tmp;
307+
308+
#pid logs/nginx.pid;
309+
310+
events {
311+
worker_connections 1024;
312+
}
313+
stream_zone buckets=1024 streams=4096;
314+
260315
rtmp {
261316
server {
262317
listen 1935;
263318
application live0 {
264319
live on;
265-
}
266-
application live1 {
267-
live on;
268-
}
320+
}
321+
application live1 {
322+
live on;
323+
}
269324
}
270325
}
271326
@@ -297,15 +352,37 @@ rtmp推流地址:rtmp://ip/live1/stream-name
297352
对应的http-ts播放地址:http://ip/live1/stream-namehttp://ip/ts1/stream-name
298353

299354
```nginx
355+
user root;
356+
daemon on;
357+
master_process on;
358+
worker_processes 1;
359+
#worker_rlimit 4g;
360+
#working_directory /usr/local/openresty/nginx/logs;
361+
362+
#error_log logs/error.log;
363+
#error_log logs/error.log notice;
364+
error_log logs/error.log info;
365+
366+
worker_rlimit_nofile 102400;
367+
worker_rlimit_core 2G;
368+
working_directory /tmp;
369+
370+
#pid logs/nginx.pid;
371+
372+
events {
373+
worker_connections 1024;
374+
}
375+
stream_zone buckets=1024 streams=4096;
376+
300377
rtmp {
301378
server {
302379
listen 1935;
303380
application live0 {
304381
live on;
305-
}
306-
application live1 {
307-
live on;
308-
}
382+
}
383+
application live1 {
384+
live on;
385+
}
309386
}
310387
}
311388
@@ -358,3 +435,66 @@ http {
358435
| live_record_min_fragment | 时间 | 8000ms | 录制过程中索引文件里记录的最小分片大小 |
359436
| live_record_max_fragment | 时间 | 12000ms | 录制过程中索引文件里记录的最大分片大小 |
360437
| live_record_buffer | 整型数 | 1024*1024 | 录制过程中数据缓冲大小 |
438+
439+
# http控制接口
440+
## 配置说明
441+
| 配置项 | 参数类型 | 默认值 | 描述 |
442+
|--|--|--|--|
443+
| rtmp_control | 选项 | all | all: 开启所有控制接口。record: 只开启录像控制接口。drop:只开启关闭连接控制接口。redirect:只开启重定向控制接口。pause:只开启暂停接口。 resume:只开启恢复接口 |
444+
445+
446+
## 控制接口说明
447+
448+
| 接口名 | 请求 | 回复 | 描述 |
449+
|--|--|--|--|
450+
| 暂停推流 | /\${location}/pause/publisher?srv=\${serverid}&app=\${app}&name=\${name} | 参考 http ack | 服务器停止转发收到的直播流 |
451+
| 恢复推流 | /\${location}/resume/publisher?srv=\${serverid}&app=\${app}&name=\${name} | 参考 http ack | 服务器恢复转发收到的直播流 |
452+
| 暂停录像 | /\${location}/record/stop?srv=\${serverid}&app=\${app}&name=\${name}&rec=\${recorder} | 参考 http ack | 暂停某条流的录像 |
453+
| 恢复录像 | /\${location}/record/start?srv=\${serverid}&app=\${app}&name=\${name}&rec=\${recorder} | 参考 http ack | 恢复某条流的录像 |
454+
455+
## 配置模板
456+
```nginx
457+
user root;
458+
daemon on;
459+
master_process on;
460+
worker_processes 1;
461+
#worker_rlimit 4g;
462+
#working_directory /usr/local/openresty/nginx/logs;
463+
464+
#error_log logs/error.log;
465+
#error_log logs/error.log notice;
466+
error_log logs/error.log info;
467+
468+
worker_rlimit_nofile 102400;
469+
worker_rlimit_core 2G;
470+
working_directory /tmp;
471+
472+
#pid logs/nginx.pid;
473+
474+
events {
475+
worker_connections 1024;
476+
}
477+
stream_zone buckets=1024 streams=4096;
478+
479+
rtmp {
480+
server {
481+
listen 1935;
482+
application live {
483+
live on;
484+
recorder rc0 {
485+
record all;
486+
record_path /tmp;
487+
}
488+
}
489+
}
490+
}
491+
492+
http {
493+
server {
494+
listen 80;
495+
location control {
496+
rtmp_control all;
497+
}
498+
}
499+
}
500+
```

‎ngx_rtmp_control_module.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ static ngx_conf_bitmask_t ngx_rtmp_control_masks[] = {
5959
{ ngx_string("record"), NGX_RTMP_CONTROL_RECORD },
6060
{ ngx_string("drop"), NGX_RTMP_CONTROL_DROP },
6161
{ ngx_string("redirect"), NGX_RTMP_CONTROL_REDIRECT },
62-
{ ngx_string("pause"), NGX_RTMP_CONTROL_PAUSE },
63-
{ ngx_string("resume"), NGX_RTMP_CONTROL_RESUME },
62+
{ ngx_string("pause"), NGX_RTMP_CONTROL_PAUSE },
63+
{ ngx_string("resume"), NGX_RTMP_CONTROL_RESUME },
6464
{ ngx_null_string, 0 }
6565
};
6666

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /