All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
通过查询分析器对比SQL语句的执行效率_[SQL,Server教程]
PHP基础:PHP4和PHP5的配置异同比较_php资料_编程技术
从小处看C#.net垃圾回收_.net资料_编程技术
AJAX在PHP中的简单使用_[PHP教程]
asp.nep设计IP地址访问限制程序_[Asp.Net教程]
[delphi语法5]delphi中Case语句的使用方法
教你轻松给流程增加权限控制程序_.net资料_编程技术
SQL2000 关于 Java JDBC 驱动的安装和设定_[SQL Server教程]
每个开发人员现在应该下载的十种必备工具,3_[Asp.Net教程]
实例讲解动态网页技术PHP开发文件系统_php资料_编程技术
Reading number is top 10 pictures
Forced sex girl living abroad2
深圳的风光
银行20年后可能消失
漂亮的跳舞妹妹1
A man's favorite things1
看看什么叫美景
The real super beauty6
Household design comfortable contracted
迷人的靓女
The mother was a stay-at-home children too tired took three baby suicide
Download software ranking
双旗镇刀客A
The cock of the Grosvenor LTD handsome
Tram sex maniac 2 (H) rar bag7
小黑猫大战两米大花蛇
Unix video tutorial15
VC++6.0简体中文版
虚拟机5.5.3版
Ashlynn Video2
Boxer's Top ten classic battle9
The hero
delv published in(发表于) 2014/1/23 3:11:05 Edit(编辑)
ASP.NET实例:Asp.net,FMS,开发视频网站_[Asp.Net教程]

ASP.NET实例:Asp.net,FMS,开发视频网站_[Asp.Net教程]

ASP.NET实例:Asp.net FMS 开发视频网站_[Asp.Net教程]

昨天看到利用FMS(Flash Media Server)做在线视频录制的资料,地址:http://www.cincn.com/article.asp?id=15,还有播放流式FLV文件的资料,地址:http://blogs.ugidotnet.org/kfra/archive/2006/10/04/50003.aspx,很好,把我高兴坏了,所以有了FMS架设视频服务器的想法, ,主要内容如下:

asp.netFMS.jpg

开发步骤:
1。下载FMS http://blogs.ugidotnet.org/kfra/archive/2006/10/04/50003.aspx,安装配置。
2。使用flash制作FMS视频采集的控件。
3。aspx页面嵌入FMS采集控件,运行采集数据上传到FMS服务器,修改数据库的视频文件存放地址。
4。页面嵌入Flash播放控件,加入FLV处理流代码:


using System;
using System.IO;
using System.Web;


/**////


/// Summary description for FLVStreaming
///

public class FLVStreaming : IHttpHandler
{
private static readonly byte[] _flvheader = HexToByte("464C5601010000000900000009"); //"FLV\x1\x1\0\0\0\x9\0\0\0\x9"


public FLVStreaming()
{
}


public void ProcessRequest(HttpContext context)
{
try
{
int pos;
int length;


// Check start parameter if present
string filename = Path.GetFileName(context.Request.FilePath);


using (FileStream fs = new FileStream(context.Server.MapPath(filename), FileMode.Open, FileAccess.Read, FileShare.Read))
{
string qs = context.Request.Params["start"];


if (string.IsNullOrEmpty(qs))
{
pos = 0;
length = Convert.ToInt32(fs.Length);
}
else
{
pos = Convert.ToInt32(qs);
length = Convert.ToInt32(fs.Length - pos) + _flvheader.Length;
}


// Add HTTP header stuff: cache, content type and length
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Cache.SetLastModified(DateTime.Now);


context.Response.AppendHeader("Content-Type", "video/x-flv");
context.Response.AppendHeader("Content-Length", length.ToString());


// Append FLV header when sending partial file
if (pos > 0)
{
context.Response.OutputStream.Write(_flvheader, 0, _flvheader.Length);
fs.Position = pos;
}


// Read buffer and write stream to the response stream
const int buffersize = 16384;
byte[] buffer = new byte[buffersize];

int count = fs.Read(buffer, 0, buffersize);
while (count > 0)
{
if (context.Response.IsClientConnected)
{
context.Response.OutputStream.Write(buffer, 0, count);
count = fs.Read(buffer, 0, buffersize);
}
else
{
count = -1;
}
}
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
}


public bool IsReusable
{
get { return true; }
}


private static byte[] HexToByte(string hexString)
{
byte[] returnBytes = new byte[hexString.Length / 2];
for (int i = 0; i < returnBytes.Length; i++)
returnBytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
return returnBytes;
}


}

修改配置文件,运行页面即可调出视频,播放速度很不错。虽说轻描淡写但已经给出应用Asp.net开发视频网站的思路。如果有兴趣可以联系我。

来源:http://www.cnblogs.com/xiucai/archive/2007/06/13/782001.html







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.