1
我想知道如何在ASP.NET中上傳視頻時捕捉視頻縮略圖?如何在ASP.NET中上傳視頻時捕獲視頻的縮略圖?
我想知道如何在ASP.NET中上傳視頻時捕捉視頻縮略圖?如何在ASP.NET中上傳視頻時捕獲視頻的縮略圖?
首先,您還需要將其轉換爲可在任何地方工作的MP4。對於可以使用的ffmpeg工具,
生成縮略圖,
//Create Thumbs
string thumbpath, thumbname;
string thumbargs;
string thumbre;
thumbpath = AppDomain.CurrentDomain.BaseDirectory + "Video\\Thumb\\";
thumbname = thumbpath + withoutext + "%d" + ".jpg";
thumbargs = "-i " + inputfile + " -vframes 1 -ss 00:00:07 -s 150x150 " + thumbname;
Process thumbproc = new Process();
thumbproc = new Process();
thumbproc.StartInfo.FileName = spath + "\\ffmpeg\\ffmpeg.exe";
thumbproc.StartInfo.Arguments = thumbargs;
thumbproc.StartInfo.UseShellExecute = false;
thumbproc.StartInfo.CreateNoWindow = false;
thumbproc.StartInfo.RedirectStandardOutput = false;
try
{
thumbproc.Start();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
thumbproc.WaitForExit();
thumbproc.Close();
然而,有關代碼的更多詳情,請參閱此鏈接。
http://ramcrishna.blogspot.com/2008/09/playing-videos-like-youtube-and.html
而且你需要根據你的web應用程序的路徑改變的路徑。
這個答案真的救了我的屁股:) –
請詳細說明您要完成的任務。你只是想做[這](http://stackoverflow.com/questions/6151348/create-thumbnail-from-video-in-asp-net)? –