asdf123382 发表于 2010-4-1 21:13:00

校园p2p视频方案

<ol>
<li>
<p style="MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="4"><b>目标与架构</b></font></font></p></li></ol>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">目标:实现在校园网或者局域网内传输</font></font><font size="3">P2P</font><font face="宋体, SimSun"><font size="3">网络电视,要求起码能负担</font></font><font size="3">500+</font><font face="宋体, SimSun"><font size="3">以上的客户端,并且客户端能收看</font></font><font size="3">800K</font><font face="宋体, SimSun"><font size="3">以上的高清电视视频,尽量减少服务器端的负荷</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">架构如下图所示</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics1" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_5cjrhctc7" width="576" height="320"/></p>
<ol start="2">
<li>
<p style="MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="4"><b>编码部分</b></font></font></p></li></ol>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">编码服务器的的主要功能是实现把电视模拟信号通过软件编码转换成数据流</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">这需要的硬件条件是,有线电视信号源,一台带电视卡的电脑(如果可以,要求</font></font><font size="3">cpu2.0G</font><font face="宋体, SimSun"><font size="3">以上,跟内存大点</font></font><font size="3">,512M</font><font face="宋体, SimSun"><font size="3">可以了)</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">软件环境要求</font></font><font size="3">winxp</font><font face="宋体, SimSun"><font size="3">,</font></font><font size="3">DX9.0</font><font face="宋体, SimSun"><font size="3">以上,</font></font><font size="3">WINDOWS MEDIA ENCODER 9.0</font><font face="宋体, SimSun"><font size="3">(这个可以免费下载的),电视卡自带的驱动跟应用软件都装好就可以了</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">我用的电视卡是天敏精灵</font></font><font size="3">3</font><font face="宋体, SimSun"><font size="3">,以下是编码的过程</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">装好各个软件以后,打开编码器:</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics2" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_6fh7p72gn" width="576" height="269"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">选择你的视频源跟音频源,然后点击视频的配置</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics3" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_7gc469hf4" width="479" height="300"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">注意选择</font></font><font size="3">TUNER</font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics4" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_853kg7c7" width="511" height="329"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">然后确定,下一步,选择自编码……</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics5" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_9fqkk4mdz" width="514" height="420"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">设置端口</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics6" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_10dfnc6hd7" width="504" height="343"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">下一步,选择</font></font><font size="3">764K</font><font face="宋体, SimSun"><font size="3">,注意把原来的默认的</font></font><font size="3">200K</font><font face="宋体, SimSun"><font size="3">的勾去掉</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics7" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_11dq23b6h2" width="500" height="340"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">然后下一步下一步直到完成,这时,因为我们是主要传输体育节目的,需要对视频编码设置做些详细的优化设置,点击下图中的属性,压缩,编辑</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics8" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_12fvzvjzcq" width="577" height="354"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">注意下图中红圈部分的设置,然后点击</font></font><font size="3">764K</font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics9" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_137ffb8sgz" width="571" height="428"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">接着设置如下,最后点确定</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics10" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_14dtwmbphs" width="572" height="476"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">然后在会话属性窗口单点击“应用”,点击总窗口的文件,保存,保存为设置文件</font></font><font size="3">8888</font><font face="宋体, SimSun"><font size="3">备以后用,然后点击开始编码就可以开始把电视信号编码成流了(窗口本来有图像的,可惜我不会截图,截下来的图看不到视频),注意,以后在运行编码器的时候最好把查看里边的视频面板的勾去掉,否则很占</font></font><font size="3">CPU</font><font face="宋体, SimSun"><font size="3">的</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics11" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_15gnzngzg6" width="576" height="373"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">现在,可以在自己机器上测试流,测试的办法是在自己的浏览器地址栏上输入</font></font><font size="3">mms://</font><font face="宋体, SimSun"><font size="3">你的</font></font><font size="3">IP: </font><font face="宋体, SimSun"><font size="3">前面设置的端口,回车,我这里举例的是</font></font><font color="#0000ff"><u><font size="3">mms://172.18.137.96:7777</font></u></font><font face="宋体, SimSun"><font size="3">,然后就能看到你的机器打开</font></font><font size="3">meidaplay</font><font face="宋体, SimSun"><font size="3">或者</font></font><font size="3">realplayer</font><font face="宋体, SimSun"><font size="3">在看你编码出来的流了</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">这样从编码器出来的流仅默认供</font></font><font size="3">5</font><font face="宋体, SimSun"><font size="3">个客户端使用,修改注册表也只能最大供</font></font><font size="3">50</font><font face="宋体, SimSun"><font size="3">个客户端连接,所以我们在下一节中,用从编码器出来的流用</font></font><font size="3">P2P</font><font face="宋体, SimSun"><font size="3">服务器推送到网络,这样就能供几</font></font><font size="3">K</font><font face="宋体, SimSun"><font size="3">的客户端连接了</font></font></p>
<ol start="3">
<li>
<p style="MARGIN-BOTTOM: 0in" class="western"><font size="4"><b>P2P</b></font><font face="宋体, SimSun"><font size="4"><b>服务器端设置部分</b></font></font></p></li></ol>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">这部分主要是把第</font></font><font size="3">2</font><font face="宋体, SimSun"><font size="3">部分编码出来的流</font></font><font size="3">P2P</font><font face="宋体, SimSun"><font size="3">推送出去,硬件要求一台配置还可以的电脑,</font></font><font size="3">CPU</font><font face="宋体, SimSun"><font size="3">内存,设置好以后可以不动他,所以可以不要显示器,甚至可以把它运行在第二部分的那台编码服务器上(我就是这么干的),当然,有条件的最好分开效果最好啦</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">软件部分要求有</font></font><font size="3">TVants</font><font face="宋体, SimSun"><font size="3">软件,这个可以去网上下,免费的,它是一个集客户端和服务器端功能于一身的一个</font></font><font size="3">P2P</font><font face="宋体, SimSun"><font size="3">网络电视软件,下来以后安装,下一步……</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">然后运行软件,点击菜单栏的工具,设置,广播设置如下</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics12" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_16frpqmqhj" width="435" height="236"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">共享那里把“仅在有共享者什么什么的”勾去掉。其他默认</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">目录服务那里选择如下,然后确定</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics13" align="bottom" src="http://www.1000bbs.com/main_html_m219a0dfa.jpg" width="504" height="356"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">在服务器那里选择添加如下,其中地址为这台机器的</font></font><font size="3">IP</font><font face="宋体, SimSun"><font size="3">地址</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics14" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_18cffrnmgq" width="577" height="283"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">确定以后,在频道那里选择添加频道如下所示,其中地址为你第二部分的编码器出来的流的地址和端口。服务器里可以下拉选择你刚建的以本机</font></font><font size="3">IP</font><font face="宋体, SimSun"><font size="3">为名的服务器,勾上隐藏源地址,确定以后可以出来画面了</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics15" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_19g6d4d3cj" width="324" height="321"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">出来的画面如下,</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics16" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_20gsnj7sd4" width="576" height="177"/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">然后你可以叉掉右边的那个视频窗口(节省内存</font></font><font size="3">cpu</font><font face="宋体, SimSun"><font size="3">),修改你刚才添加的频道,把锁定频道状态的勾勾上,点击确定,然后在频道那里选择你的频道的详情,</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><br/></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><img border="0" name="graphics17" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_21f7p34hhm" width="460" height="276"/><font face="宋体, SimSun"><font size="3">把发布地址的字符串“</font></font><font size="3">tvants://172.18.137.96/tvants/?k=b1e014e4b722bdc8648324cf63a6689a”</font><font face="宋体, SimSun"><font size="3">选中,复制到文本,以后供客户端使用</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">最小化</font></font><font size="3">TVANTS</font><font face="宋体, SimSun"><font size="3">软件,它会自动最小化到右下角</font></font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="3">到现在为止,</font></font><font size="3">P2P</font><font face="宋体, SimSun"><font size="3">服务器端的设置就完成了,下一节介绍客户端然后使用将本节得到的公告地址“</font></font><font size="3">tvants://172.18.13……”</font><font face="宋体, SimSun"><font size="3">来</font></font><font size="3">P2P</font><font face="宋体, SimSun"><font size="3">收看电视</font></font></p>
<ol start="4">
<li>
<p style="MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><b><font size="4">发布部分和客户端部分</font></b></font></p></li></ol>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font size="3">1</font><font face="宋体, SimSun"><font size="3">,如果客户端装了</font></font><font size="3">tvants</font><font face="宋体, SimSun"><font size="3">软件就叫他们直接在浏览器上打开第三部分得到的地址“</font></font><font size="3">tvants://172.18.137.96/tvants/?k=b1e014e4b722bdc8648324cf63a6689a”</font><font face="宋体, SimSun"><font size="3">就可以直接收看了,另外要求客户端最好装有</font></font><font size="3">mediaplayer10</font></p>
<p style="TEXT-INDENT: 0.21in; MARGIN-BOTTOM: 0in" class="western"><font size="3">2</font><font face="宋体, SimSun"><font size="3">,如果希望以网页的形式发布,也可以自己建立一个网页,在网页中内嵌以下代码:</font></font></p>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><font face="宋体, SimSun"><font size="2">&lt;object classid="clsid:4C833081-D026-4FF8-968F-7EAB660D2FBA" id="TvantsX" CODEBASE=" http://download.tvants.com/pub/tvants/tvants1/win32/cab/tvants.cab#Version=1,0,0,58 " width=100% height=100% &gt;</font></font></p>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><font size="2"><font face="宋体, SimSun">&lt;param name="Title" value="TR tv"&gt; </font></font></p>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><font face="宋体, SimSun"><font size="2">&lt;param name="URL" value=" tvants://172.18.137.96/tvants/?k=b1e014e4b722bdc8648324cf63a6689a"&gt; </font></font></p>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><font face="宋体, SimSun"><font size="2">&lt;/object&gt;</font></font></p>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><font face="宋体, SimSun"><font size="2">客户端打开网页后就可以在网页上收看你的节目了,第一次看它会自动从</font></font><font color="#0000ff"><u><a href="http://download.tvants.com/pub/tvants/tvants1/win32/cab/tvants.cab#Version=1,0,0,58"><font size="2"><font face="宋体, SimSun">http://download.tvants.com/pub/tvants/tvants1/win32/cab/tvants.cab#Version=1,0,0,58</font></font></a></u></font><font face="宋体, SimSun"><font size="2">下载插件,你也可以叫他们下载了插件手动安装</font></font></p>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><font face="宋体, SimSun"><font size="2">这个是今天上午火箭对爵士第四场时我这边运行的情况</font></font></p>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><img border="0" name="graphics18" align="bottom" src="http://www.1000bbs.com/File?id=df8m7dff_22ggh9twgb" width="577" height="149"/></p>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><br/></p>
<ol start="5">
<li>
<p style="MARGIN-BOTTOM: 0in" class="western"><font face="宋体, SimSun"><font size="4"><b>总结与已知问题</b></font></font></p></li></ol>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><font face="宋体, SimSun"><font size="2">这个方案比我以前的</font></font><font size="2"><font face="宋体, SimSun">encoder</font></font><font face="宋体, SimSun"><font size="2">+</font></font><font size="2"><font face="宋体, SimSun">win2003</font></font><font face="宋体, SimSun"><font size="2">的</font></font><font size="2"><font face="宋体, SimSun">media server</font></font><font face="宋体, SimSun"><font size="2">好,以前的最多</font></font><font size="2"><font face="宋体, SimSun">200</font></font><font face="宋体, SimSun"><font size="2">个连接差不多服务器负荷就</font></font><font size="2"><font face="宋体, SimSun">100</font></font><font face="宋体, SimSun"><font size="2">%了,现在在同一台机器上做编码和</font></font><font size="2"><font face="宋体, SimSun">P2P</font></font><font face="宋体, SimSun"><font size="2">服务器</font></font><font size="2"><font face="宋体, SimSun">600</font></font><font face="宋体, SimSun"><font size="2">客户左右我的</font></font><font size="2"><font face="宋体, SimSun">cpu</font></font><font face="宋体, SimSun"><font size="2">负荷才</font></font><font size="2"><font face="宋体, SimSun">50</font></font><font face="宋体, SimSun"><font size="2">%不到。</font></font></p>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><font face="宋体, SimSun"><font size="2">已知的问题主要出在第二部分,也就是编码部分,国内的电视卡的驱动做的很差,有时存在兼容性问题。</font></font></p>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><font face="宋体, SimSun"><font size="2">我用过感觉比较好的是佳的美</font></font><font size="2"><font face="宋体, SimSun">PT307</font></font><font face="宋体, SimSun"><font size="2">的,在</font></font><font size="2"><font face="宋体, SimSun">XP</font></font><font face="宋体, SimSun"><font size="2">和</font></font><font size="2"><font face="宋体, SimSun">win2003</font></font><font face="宋体, SimSun"><font size="2">(需要装</font></font><font size="2"><font face="宋体, SimSun">SP2</font></font><font face="宋体, SimSun"><font size="2">)下表现都不错,当初买了</font></font><font size="2"><font face="宋体, SimSun">90RMB</font></font><font face="宋体, SimSun"><font size="2">,但是在第二步中的点击开始编码前要运行一下电视卡的应用软件然后再关掉再点击开始编码,否则出来的图像会下边少一截;</font></font></p>
<p style="MARGIN-BOTTOM: 0in" class="western" align="left"><font face="宋体, SimSun"><font size="2">现在用的这个天敏的</font></font><font size="2"><font face="宋体, SimSun">tvbaby3</font></font><font face="宋体, SimSun"><font size="2">在</font></font><font size="2"><font face="宋体, SimSun">xp</font></font><font face="宋体, SimSun"><font size="2">下表现还行,但是在点击开始编码以后有可能出现只有雪花点的情况,这时需要在编码状态下打开电视卡应用软件再关掉;接着这时可能有图像但是没有声音,需要点击停止编码再点击开始编码就可以了。在</font></font><font size="2"><font face="宋体, SimSun">win2003</font></font><font face="宋体, SimSun"><font size="2">下一装驱动就死机,所以天敏的不适合在</font></font><font size="2"><font face="宋体, SimSun">2k3</font></font><font face="宋体, SimSun"><font size="2">下运行 </font></font><font size="2"><font face="宋体, SimSun">by T.R </font></font></p><br/>

11as 发表于 2010-4-5 11:54:00

好东西,不过图我怎么都看不见。是我电脑的问题吗

blue86 发表于 2010-4-13 11:49:00

看不到图··

hhlcmm 发表于 2010-4-13 17:15:00

看不到图、还想对比下我之前做的、其实这种东西,跟产品的选择关系很大。好产品,做出来的项目一定好、不好的产品,图像会延迟。更可怕的是图像,声音都延迟,而且每个地方的延迟都不一样。这样很可怕,我之前就看过一个这样的

babyvoxwangjian 发表于 2010-4-14 09:37:00

没图片.
页: [1]
查看完整版本: 校园p2p视频方案