0
我正在創建類似於YouTube的網站,因此在將視頻(將以.flv格式)上傳到項目文件夾後,必須從中捕獲縮略圖對應視頻..我在這裏使用的設計asp.net & C#我的網頁...如何從文件夾中的視頻捕捉縮略圖
我有從網上的一些代碼,但它的工作只是大小2-3Mb的視頻....
任何人都可以幫助我工作我的代碼大型文件..
這裏是我的代碼..
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
using All4DotNet;
namespace LiveStreaming
{
public class Class1
{
public static void GrabSingle_Thumb()
{
//Declare object of class MediaManagerPro
MediaManagerPro oMediaManagerPro = new MediaManagerPro();
//Get the rooth path
string strRootPath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath);
//set the directory path info for ffmpeg file
oMediaManagerPro.FFMPEG_Path = HttpContext.Current.Server.MapPath("~\\ffmpeg\\ffmpeg.exe");
//Set source file info
oMediaManagerPro.SourceFile_Path = strRootPath + "Videos";
oMediaManagerPro.SourceFile_Name = "HelloWorld.flv";
//set output file info
oMediaManagerPro.OutputFile_Path = strRootPath + "Images";
//Single Thumb - Properties available in free version
oMediaManagerPro.Frame_Time = "5";
oMediaManagerPro.Image_Format = "jpg";
oMediaManagerPro.Image_Name = "Image_" + DateTime.Now.Ticks;
////Single Thumb - Properties available in full version
//oMediaManagerPro.Width = 320;
//oMediaManagerPro.Height = 240;
//grab thumbnails
MediaInfo oMediaInfo = oMediaManagerPro.Grab_Thumb();
#region Print Output Information
StringBuilder strOutputInfo = new StringBuilder();
strOutputInfo.Append("Image Created = " + oMediaInfo.File_Name + "<br />");
HttpContext.Current.Response.Write(strOutputInfo);
#endregion
}
}
}
我得到這個代碼http://www.helpprogrammers.com/csharpsample.aspx
請解釋大文件會發生什麼,你會得到一個異常嗎?你有任何類型的錯誤信息?某種程度上你的輸出損壞了嗎? –
沒有代碼正常運行,但沒有爲3mb以上的文件大小生成縮略圖。 –