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)? –