C# 如何从上传的MP4视频中提取图像-FFMPEG
我正在为我的公司建立一个培训网站,我们需要从上传的每个mp4视频中提取一个图像。我搜索了很多,决定试试FFMPEG 这是我到目前为止所拥有的。我没有收到错误,但指定文件夹中没有图像 任何帮助都将不胜感激C# 如何从上传的MP4视频中提取图像-FFMPEG,c#,asp.net,video,ffmpeg,C#,Asp.net,Video,Ffmpeg,我正在为我的公司建立一个培训网站,我们需要从上传的每个mp4视频中提取一个图像。我搜索了很多,决定试试FFMPEG 这是我到目前为止所拥有的。我没有收到错误,但指定文件夹中没有图像 任何帮助都将不胜感激 字符串inputfile=Server.MapPath(“/Report/TrainingLibrary/Material/Videos/RMSIMAILSignature.mp4”); //不带文本的字符串; 字符串路径; 字符串拇指名称; 字符串拇指参数; //弦指; thumbpath=
字符串inputfile=Server.MapPath(“/Report/TrainingLibrary/Material/Videos/RMSIMAILSignature.mp4”);
//不带文本的字符串;
字符串路径;
字符串拇指名称;
字符串拇指参数;
//弦指;
thumbpath=AppDomain.CurrentDomain.BaseDirectory+“报告\\培训库\\材料\\视频\\”;
thumbname=thumbpath+“图像”+“%d”+“.jpg”;
thumbargs=“-i”+inputfile+”-vframes 1-ss 00:00:07-s 150x150”+thumbname;
进程thumbproc=新进程();
thumbproc=新进程();
thumbproc.StartInfo.FileName=“C:\\FFMPEG\\Bin\\FFMPEG.exe”;
thumbproc.StartInfo.Arguments=thumbargs;
thumbproc.StartInfo.UseShellExecute=false;
thumbproc.StartInfo.CreateNoWindow=false;
thumbproc.StartInfo.RedirectStandardOutput=false;
尝试
{
thumbproc.Start();
}
捕获(例外情况除外)
{
响应。写入(例如消息);
}
thumbproc.WaitForExit();
thumbproc.Close()
您看到了吗:如果您通过命令行手动运行ffmpeg
,它会工作吗?如果是,那么问题在于您的脚本。