基于开源Flash Server:Red5构建RTMP流媒体播放平台
来源:互联网 发布:源码 试用系统 编辑:程序博客网 时间:2024/06/06 08:52
一、Flash RTMP流媒体播放演示(播放时进度条可以自由拖动):
二、安装步骤简要说明:
①、安装JDK
,下载最新的Java SE Development Kit (JDK),安装在/usr/local/jdk/下。
②、安装Red5
下载red5-0.7.0.tar.gz,解压缩后执行./red5.sh,然后访问://yourdomain:5080/,有演示。
三、服务器带宽消耗比较:
①、客户端 1.5M ADSL 环境,HTTP 方式播放单个视频,服务器所消耗的带宽:
②、客户端 1.5M ADSL 环境,RTMP 流媒体方式播放单个视频,服务器所消耗的带宽:
HTTP 方式播放,如果服务器端不限速,客户端的带宽越大,服务器消耗的带宽也越大,但限速又会影响用户体验;
RTMP 流媒体方式播放,只要客户端达到最低带宽要求,不管客户端的带宽如何,服务器消耗的带宽都一样。
如果播放10M以内大小的视频,HTTP 能够在较短的时间内下载完视频,能够降低并发观看用户数;
如果播放10M以上大小的视频,RTMP 要比 HTTP 方式节省不少带宽。
RTMP 播放时进度条可以自由拖动,虽然Lighttpd和Nginx目前也可以使用somevideo.flv?start=xxx的方式从指定位置下载视频,但还是不如 RTMP 灵活。
四、带宽测试Shell脚本(net.sh):
二、安装步骤简要说明:
①、安装JDK
,下载最新的Java SE Development Kit (JDK),安装在/usr/local/jdk/下。
chmod +x jdk-6u13-linux-i586.bin
./jdk-6u13-linux-i586.bin
./jdk-6u13-linux-i586.bin
②、安装Red5
下载red5-0.7.0.tar.gz,解压缩后执行./red5.sh,然后访问://yourdomain:5080/,有演示。
三、服务器带宽消耗比较:
①、客户端 1.5M ADSL 环境,HTTP 方式播放单个视频,服务器所消耗的带宽:
[root@localhost ~]# ./net.sh eth0 1
IN: 3318 Byte/s OUT: 259984 Byte/s
IN: 3486 Byte/s OUT: 249470 Byte/s
IN: 3332 Byte/s OUT: 259984 Byte/s
IN: 3090 Byte/s OUT: 252528 Byte/s
IN: 3000 Byte/s OUT: 252474 Byte/s
IN: 3000 Byte/s OUT: 253976 Byte/s
IN: 2940 Byte/s OUT: 255478 Byte/s
IN: 3004 Byte/s OUT: 252474 Byte/s
IN: 3452 Byte/s OUT: 252528 Byte/s
IN: 3270 Byte/s OUT: 260038 Byte/s
IN: 3586 Byte/s OUT: 252474 Byte/s
IN: 3318 Byte/s OUT: 259984 Byte/s
IN: 3486 Byte/s OUT: 249470 Byte/s
IN: 3332 Byte/s OUT: 259984 Byte/s
IN: 3090 Byte/s OUT: 252528 Byte/s
IN: 3000 Byte/s OUT: 252474 Byte/s
IN: 3000 Byte/s OUT: 253976 Byte/s
IN: 2940 Byte/s OUT: 255478 Byte/s
IN: 3004 Byte/s OUT: 252474 Byte/s
IN: 3452 Byte/s OUT: 252528 Byte/s
IN: 3270 Byte/s OUT: 260038 Byte/s
IN: 3586 Byte/s OUT: 252474 Byte/s
②、客户端 1.5M ADSL 环境,RTMP 流媒体方式播放单个视频,服务器所消耗的带宽:
[root@localhost ~]# ./net.sh eth0 1
IN: 3900 Byte/s OUT: 27878 Byte/s
IN: 4200 Byte/s OUT: 30868 Byte/s
IN: 4380 Byte/s OUT: 27801 Byte/s
IN: 4080 Byte/s OUT: 29965 Byte/s
IN: 4080 Byte/s OUT: 26450 Byte/s
IN: 3960 Byte/s OUT: 27143 Byte/s
IN: 3000 Byte/s OUT: 10061 Byte/s
IN: 3960 Byte/s OUT: 16166 Byte/s
IN: 3660 Byte/s OUT: 26480 Byte/s
IN: 4020 Byte/s OUT: 23127 Byte/s
IN: 3900 Byte/s OUT: 27878 Byte/s
IN: 4200 Byte/s OUT: 30868 Byte/s
IN: 4380 Byte/s OUT: 27801 Byte/s
IN: 4080 Byte/s OUT: 29965 Byte/s
IN: 4080 Byte/s OUT: 26450 Byte/s
IN: 3960 Byte/s OUT: 27143 Byte/s
IN: 3000 Byte/s OUT: 10061 Byte/s
IN: 3960 Byte/s OUT: 16166 Byte/s
IN: 3660 Byte/s OUT: 26480 Byte/s
IN: 4020 Byte/s OUT: 23127 Byte/s
HTTP 方式播放,如果服务器端不限速,客户端的带宽越大,服务器消耗的带宽也越大,但限速又会影响用户体验;
RTMP 流媒体方式播放,只要客户端达到最低带宽要求,不管客户端的带宽如何,服务器消耗的带宽都一样。
如果播放10M以内大小的视频,HTTP 能够在较短的时间内下载完视频,能够降低并发观看用户数;
如果播放10M以上大小的视频,RTMP 要比 HTTP 方式节省不少带宽。
RTMP 播放时进度条可以自由拖动,虽然Lighttpd和Nginx目前也可以使用somevideo.flv?start=xxx的方式从指定位置下载视频,但还是不如 RTMP 灵活。
四、带宽测试Shell脚本(net.sh):
#!/bin/bash
# test network width
function usage
{
echo "Usage: $0 "
echo " e.g. $0 eth0 2"
exit 65
}
if [ $# -lt 2 ];then
usage
fi
typeset in in_old dif_in
typeset out out_old dif_out
typeset timer
typeset eth
eth=$1
timer=$2
in_old=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk ' { print $1 }' )
out_old=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk ' { print $9 }' )
while true
do
sleep ${timer}
in=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk ' { print $1 }' )
out=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk ' { print $9 }' )
dif_in=$(((in-in_old)/timer))
dif_out=$(((out-out_old)/timer))
echo "IN: ${dif_in} Byte/s OUT: ${dif_out} Byte/s"
in_old=${in}
out_old=${out}
done
exit 0
# test network width
function usage
{
echo "Usage: $0 "
echo " e.g. $0 eth0 2"
exit 65
}
if [ $# -lt 2 ];then
usage
fi
typeset in in_old dif_in
typeset out out_old dif_out
typeset timer
typeset eth
eth=$1
timer=$2
in_old=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk ' { print $1 }' )
out_old=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk ' { print $9 }' )
while true
do
sleep ${timer}
in=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk ' { print $1 }' )
out=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk ' { print $9 }' )
dif_in=$(((in-in_old)/timer))
dif_out=$(((out-out_old)/timer))
echo "IN: ${dif_in} Byte/s OUT: ${dif_out} Byte/s"
in_old=${in}
out_old=${out}
done
exit 0
0 0
- 基于开源Flash Server:Red5构建RTMP流媒体播放平台
- 开源Flash Server:Red5构建RTMP流媒体播放平台
- RTMP流媒体播放之red5
- 基于RTMP协议的Flash流媒体网页直播播放器
- Red5 搭建基于RTMP协议的流媒体服务器
- 最简单的基于Flash的流媒体示例:网页播放器(HTTP,RTMP,HLS)
- 最简单的基于Flash的流媒体示例:网页播放器(HTTP,RTMP,HLS)
- 最简单的基于Flash的流媒体示例:网页播放器(HTTP,RTMP,HLS)
- 最简单的基于Flash的流媒体示例:网页播放器(HTTP,RTMP,HLS)
- 最简单的基于Flash的流媒体示例:网页播放器(HTTP,RTMP,HLS)
- 最简单的基于Flash的流媒体示例:网页播放器(HTTP,RTMP,HLS)
- 最简单的基于Flash的流媒体示例:网页播放器(HTTP,RTMP,HLS)
- 最简单的基于Flash的流媒体示例:网页播放器(HTTP,RTMP,HLS)
- 开源的Flash流媒体服务器red5简介
- 播放基于流媒体服务器的视频,本例基于 RED5
- 关于red5——开源的Flash流媒体服务器red5简介
- 使用Red5和FFMpeg搭建在线Flash流媒体分享平台
- red5流媒体平台搭建
- OpenSessionInViewFilter作用及配置
- Java从控制台中读取数据的各种方法
- UVa 10152 龟壳排序
- 写程序时音量百分比和分贝之间的转换
- poj2155
- 基于开源Flash Server:Red5构建RTMP流媒体播放平台
- 分数类的雏形
- Java模式设计之单例模式
- QQ群推广的一些经验分享
- SEO优化之竞争对手的研究
- zTree实现地市县三级级联Service接口实现
- jplogic v1.0案例开发之知识库管理(文档管理等)(二)
- 《C++ Primer(第5版)》学习笔记:第3章 字符串、向量和数组
- zTree实现地市县三级级联Service接口测试