Je veux créer une vignette d'un fichier vidéo téléchargé dans mon application pour cela J'ai utilisé ffmpeg
. Le code est le suivant:créer une vignette à partir de la vidéo dans asp.net
string thumbpath, thumbname;
string thumbargs;
string thumbre;
thumbpath = Server.MapPath("~/thumbnails/");
thumbname = thumbpath + "Test" + ".png";
string f = Server.MapPath("~/testvideo.wmv");
thumbargs = "-i " + f + " -vcodec png -vframes 1 -ss 00:00:07 -s 150x150 " + thumbname;
Process thumbproc = new Process();
thumbproc = new Process();
thumbproc.StartInfo.FileName = Server.MapPath("~\\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();
mais il lance une exception:
MainModule = 'thumbproc.MainModule'
threw an exception of type 'System.ComponentModel.Win32Exception'
Si quelqu'un a une idée alors s'il vous plaît le faire savoir.
expliqueriez-vous ce que sont 'lsServerPath',' 'lsFBitmapName' et lsFJpegName' comment voulez-vous défini urls et les chemins? –