-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx-rtmp搭建.txt
192 lines (142 loc) · 10.1 KB
/
nginx-rtmp搭建.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
./configure --prefix=/usr/local/nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --add-module=/mnt/nginx-module/nginx-rtmp-module --add-module=/mnt/nginx-module/nginx-rtmp-module/hls --with-debug
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --add-module=/mnt/nginx-module/nginx-rtmp-module --add-module=/mnt/nginx-module/nginx-rtmp-module/hls --with-debug
http://blog.csdn.net/ystyaoshengting/article/details/48436409
H5视频直播扫盲
http://blog.csdn.net/dj0379/article/details/51946664
-----------------------------SRS--simple rtmp server------------------------------------------------
SRS
https://github.com/ossrs/srs#usage
https://github.com/ossrs/srs/wiki/v3_CN_Home
https://github.com/ossrs/srs/wiki/v3_CN_SampleHLS
srs之与nginx-rtmp性能对比
http://blog.csdn.net/zjqlovell/article/details/50785867
安装:
Step 1: get SRS
git clone https://github.com/ossrs/srs &&
cd srs/trunk
Step 2: build SRS, Requires Centos6.x/Ubuntu12 32/64bits, others see Build(CN,EN).
https://github.com/ossrs/srs/wiki/v2_CN_Build
查看帮助:./configure -h
./configure --full --jobs=4
./configure && make
-------------------start
build summary:
+------------------------------------------------------------------------------------
|{disabled} gperf @see: https://github.com/ossrs/srs/wiki/v1_CN_GPERF
| {disabled} gmc @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html
| {disabled} gmc: gperf memory check, or memory leak detect
| {disabled} env PPROF_PATH=./objs/pprof HEAPCHECK=normal ./objs/srs -c conf/console.conf 2>gmc.log # start gmc
| {disabled} killall -2 srs # or CTRL+C to stop gmc
| {disabled} cat gmc.log # to analysis memory leak
| {disabled} gmp @see: http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html
| {disabled} gmp: gperf memory profile, similar to gcp
| {disabled} rm -f gperf.srs.gmp*; ./objs/srs -c conf/console.conf # start gmp
| {disabled} killall -2 srs # or CTRL+C to stop gmp
| {disabled} ./objs/pprof --text objs/srs gperf.srs.gmp* # to analysis memory profile
| {disabled} gcp @see: http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
| {disabled} gcp: gperf cpu profile
| {disabled} rm -f gperf.srs.gcp*; ./objs/srs -c conf/console.conf # start gcp
| {disabled} killall -2 srs # or CTRL+C to stop gcp
| {disabled} ./objs/pprof --text objs/srs gperf.srs.gcp* # to analysis cpu profile
+------------------------------------------------------------------------------------
|{disabled} gprof @see: https://github.com/ossrs/srs/wiki/v1_CN_GPROF
|{disabled} gprof: GNU profile tool, @see: http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html
| {disabled} rm -f gmon.out; ./objs/srs -c conf/console.conf # start gprof
| {disabled} killall -2 srs # or CTRL+C to stop gprof
| {disabled} gprof -b ./objs/srs gmon.out > gprof.srs.log && rm -f gmon.out # gprof report to gprof.srs.log
+------------------------------------------------------------------------------------
|utest: ./objs/srs_utest, the utest for srs
+------------------------------------------------------------------------------------
|librtmp @see: https://github.com/ossrs/srs/wiki/v1_CN_SrsLibrtmp
|librtmp: ./objs/include, ./objs/lib, the srs-librtmp library
| simple handshake: publish/play stream with simple handshake to server
| complex handshake: it's not required for client, recommend disable it
| librtmp-sample: ./research/librtmp, the srs-librtmp client sample
| librtmp-sample: ./research/librtmp/objs/srs_ingest_flv
| librtmp-sample: ./research/librtmp/objs/srs_ingest_rtmp
| librtmp-sample: ./research/librtmp/objs/srs_detect_rtmp
| librtmp-sample: ./research/librtmp/objs/srs_bandwidth_check
+------------------------------------------------------------------------------------
|{disabled} research: ./objs/research, api server, players, ts info, librtmp.
| {disabled} @see https://github.com/ossrs/srs/wiki/v2_CN_SrsLibrtmp#srs-librtmp-examples
+------------------------------------------------------------------------------------
|tools: important tool, others @see https://github.com/ossrs/srs/wiki/v2_CN_SrsLibrtmp#srs-librtmp-examples
| ./objs/srs_ingest_hls -i http://ossrs.net/live/livestream.m3u8 -y rtmp://127.0.0.1/live/livestream
+------------------------------------------------------------------------------------
|server: ./objs/srs -c conf/srs.conf, start the srs server
| hls @see: https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHLS
| hls: generate m3u8 and ts from rtmp stream
| dvr @see: https://github.com/ossrs/srs/wiki/v2_CN_DVR
| dvr: record RTMP stream to flv files.
| {disabled} nginx @see: https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHLS
| {disabled} nginx: delivery HLS stream by nginx
| {disabled} nginx: sudo ./objs/nginx/sbin/nginx
| ssl @see: https://github.com/ossrs/srs/wiki/v1_CN_RTMPHandshake
| ssl: support RTMP complex handshake for client required, for instance, flash
| {disabled} ffmpeg @see: https://github.com/ossrs/srs/wiki/v1_CN_FFMPEG
| {disabled} ffmpeg: transcode, mux, ingest tool
| {disabled} ffmpeg: ./objs/ffmpeg/bin/ffmpeg
| transcode @see: https://github.com/ossrs/srs/wiki/v1_CN_FFMPEG
| transcode: support transcoding RTMP stream
| ingest @see: https://github.com/ossrs/srs/wiki/v1_CN_Ingest
| ingest: support ingest file/stream/device then push to SRS by RTMP stream
| http-callback @see: https://github.com/ossrs/srs/wiki/v2_CN_HTTPCallback
| http-callback: support http callback for authentication and event injection
| http-server @see: https://github.com/ossrs/srs/wiki/v2_CN_HTTPServer
| http-server: support http server to delivery http stream
| http-api @see: https://github.com/ossrs/srs/wiki/v2_CN_HTTPApi
| http-api: support http api to manage server
| {disabled} stream-caster @see: https://github.com/ossrs/srs/wiki/v2_CN_Streamer
| {disabled} stream-caster: start server to cast stream over other protocols.
+------------------------------------------------------------------------------------
binaries @see: https://github.com/ossrs/srs/wiki/v2_CN_Build
You can:
./objs/srs -c conf/srs.conf
to start the srs server, with config conf/srs.conf.
------------------end
Step 3: start SRS
./objs/srs -c conf/srs.conf
--------------rtmp推流
for((;;)); do \
./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv \
-vcodec copy -acodec copy \
-f flv -y rtmp://121.40.19.121/live/livestream; \
sleep 1; \
done
vlc:rtmp://121.40.19.121/live/livestream
https://github.com/ossrs/srs/wiki/v2_CN_HTTPCallback
默认的HTTP服务器
SRS不支持服务器脚本(参考:服务器端脚本),服务器端定制有一个重要的替代功能,就是HTTP回调。譬如当客户端连接到SRS时,回调指定的http地址,这样可以实现验证功能
token机制:https://github.com/ossrs/srs/wiki/v1_CN_DRM#token-authentication
python research/api-server/server.py 8085
https://github.com/ossrs/srs-bench
使用linux工具模拟RTMP客户端访问,参考:srs-bench
https://github.com/ossrs/srs/wiki/v1_CN_SampleRealtime
SRS RTMP 低延迟配置
直播体系分析
http://blog.csdn.net/gitchat/article/details/78785463
jw player是一个在网页上使用的Flash视频、音频以及图片开源播放器,支持Sliverlight播放,也支持各种流和播放清单格式,并播放背景音乐。
FFMPEG参数
https://github.com/ossrs/srs/wiki/v1_CN_FFMPEG
FFMPEG转码部署实例
https://github.com/ossrs/srs/wiki/v1_CN_SampleFFMPEG
SRS主备热部署
https://github.com/ossrs/srs/wiki/v1_CN_SampleForward
转封装成HTTP-FLV流
https://github.com/ossrs/srs/wiki/v2_CN_SampleHttpFlv
录制成FLV
https://github.com/ossrs/srs/wiki/v2_CN_DVR
SRS提供HTTP接口,供外部程序管理服务器,
https://github.com/ossrs/srs/wiki/v2_CN_HTTPApi#kickoff-client
http测试地址or curl指令
http://ossrs.net/srs.release/http-rest/
带宽测试
https://github.com/ossrs/srs/wiki/v1_CN_BandwidthTestTool
帮助文档
https://github.com/ossrs/srs/wiki/v2_CN_Docs
RTMP低延时配置
https://github.com/ossrs/srs/wiki/v2_CN_SampleRealtime
日志配置
https://github.com/ossrs/srs/wiki/v1_CN_SrsLog
ffmpeg -re -i source.200kbps.768x320.flv -vcodec copy -acodec copy -f flv -y rtmp://121.40.19.121/live/123;
./objs/ffmpeg/bin/ffmpeg -re -i ./doc/aaa.mp4 -vcodec copy -acodec copy -f flv -y rtmp://live.kidmadeto.com/live/123;