C# 如何在ASP.NET中上载视频时捕获缩略图?
我想知道如何在ASP.NET中上传视频时捕获缩略图?首先,您还需要将其转换为MP4,它可以在任何地方工作。为此,您可以使用ffmpeg工具 要创建缩略图C# 如何在ASP.NET中上载视频时捕获缩略图?,c#,asp.net,video-thumbnails,C#,Asp.net,Video Thumbnails,我想知道如何在ASP.NET中上传视频时捕获缩略图?首先,您还需要将其转换为MP4,它可以在任何地方工作。为此,您可以使用ffmpeg工具 要创建缩略图 //Create Thumbs string thumbpath, thumbname; string thumbargs; string thumbre; thumbpath = AppDomain.CurrentDomain.BaseDirectory + "Video\\Thumb\\"; thumbname = thumbpath +
//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();
但是,有关代码的更多详细信息,请参阅此链接
您还需要根据web应用程序的路径更改路径。请详细说明您要实现的目标。你只是想这么做吗?这个答案真的救了我一命:)