四、基本功能测试:
播放器采用开源播放器jwplayer,将播放器放到index.html同级目录下
NGINX-Http测试页面index.html(切记http的时候需要给视频添加关键帧)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test of nginx-http</title>
</head>
<body>
<div></div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="https://www.linuxidc.com/player.swf" />
<param value="high" />
<param value="opaque" />
<param value="6.0.65.0" />
<param value="type=http&file=http://192.168.0.33:8081/2.flv&autostart=true">
<EMBED SRC="https://www.linuxidc.com/player.swf" QUALITY="high" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/i
ndex.cgi?P1_Prod_Version=ShockwaveFlash" flashvars="type=http&file=http://192.168.0.33:8081/2.flv&autostart=true" wmode="opaq
ue" />
</object>
</body>
</html>
NGINX-RTMP测试页面index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>nginx-rtmp</title>
</head>
<body>
<div></div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="https://www.linuxidc.com/player.swf" />
<param value="high" />
<param value="opaque" />
<param value="6.0.65.0" />
<param value="streamer=rtmp://192.168.0.33:1935/vod&file=2.flv&autostart=true">
<EMBED SRC="https://www.linuxidc.com/player.swf" QUALITY="high" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/i
ndex.cgi?P1_Prod_Version=ShockwaveFlash" flashvars="streamer=rtmp://192.168.0.33:1935/vod&file=2.flv&autostart=true" wmode="o
paque" />
</object>
</body>
</html>
页面能打开正常播放就说明配置是正确的。
五、并发测试
NGINX-HTTP采用loadrunner测试(略)
NGINX-RTMP采用开源软件flazr测试:
前提需要安装jdk软件
client.bat rtmp://192.168.0.33:1935/vod/2.flv -load 500
这里的500是并发数
由于局域网的限制,带宽测试到一定大小的时候就上不去了,故此步截图不忽略。