//c#获取MP4文件夹下所有视频文件,然后批量提取视频中的图片,命名为MP4的文件.jpg
string[] files = Directory.GetFiles(folderPath, "*.mp4", SearchOption.AllDirectories);
foreach (string file in files)
{
using (System.Diagnostics.Process process = new System.Diagnostics.Process())
{
process.StartInfo.FileName = @"C:\Program Files\ffmpeg\bin\ffmpeg.exe";
string fileName = Path.GetFileName(file).Replace("#","").Replace(".mp4","");
process.StartInfo.Arguments = @"-i " + file + " -ss 5 -f image2 D:\\fangyuan\\"+fileName+".jpg";
process.Start();
}
}
c#批量提取视频中的图片
最新推荐文章于 2024-07-21 12:43:51 发布