首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SharpFFMpeg ffmpeg转换图例

SharpFFMpeg ffmpeg转换图例
EN

Stack Overflow用户
提问于 2009-10-22 14:49:35
回答 2查看 6.4K关注 0票数 2

我正在寻找一个好的教程,或者如何在c#中使用SharpFFMpeg,或者是否有一个简单的方法来使用FMPEG...

我想转换视频。(X格式)到video.flv的屏幕截图,并保存为我去。

如果有一个很好的教程,或者你知道一个简单的方法,请在这里张贴。

谢谢,基兰

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2009-10-26 14:31:26

运行命令行参数www.codeproject.com/KB/cs/Execute_Command_in_CSharp.aspx

提取图像http://stream0.org/2008/02/howto-extract-images-from-a-vi.html

代码语言:javascript
复制
    protected void BTN_convert_Click(object sender, EventArgs e) {

  String runMe = @"C:\Documents and Settings\Wasabi Digital\My Documents\Visual Studio 2008\Projects\Evo\WEB\Bin\ffmpeg.exe";  
  String pathToFiles = @"C:\Documents and Settings\Wasabi Digital\My Documents\Visual Studio 2008\Evo\WEB\test\";    
  String convertVideo = " -i \"" + pathToFiles + "out.wmv\" \"" + pathToFiles + "sample3.flv\" ";
  String makeImages = " -i \"" + pathToFiles + "out.wmv\" -r 1 -ss 00:00:01 -t 00:00:15 -f image2 -s 120x96 \"" + pathToFiles + "images%05d.png\"";
  this.ExecuteCommandSync(runMe,convertVideo);
  this.ExecuteCommandSync(runMe, makeImages);
 }

这是取自第一个链接的代码片段。命令用法周围的额外引号使其名称中包含空格。例如“.../我的文档/...”

代码语言:javascript
复制
public void ExecuteCommandSync(String command, String args) {


 try {   
   System.Diagnostics.ProcessStartInfo procStartInfo =
    new System.Diagnostics.ProcessStartInfo("\""+command+"\"",args);

   Process.StandardOutput StreamReader.
   procStartInfo.RedirectStandardOutput = true;
   procStartInfo.UseShellExecute = false;

   procStartInfo.CreateNoWindow = true;

   System.Diagnostics.Process proc = new System.Diagnostics.Process();
   proc.StartInfo = procStartInfo;
   proc.Start();

   string result = proc.StandardOutput.ReadToEnd();

   Debug.WriteLine(result);
  } catch (Exception objException) {   
   // Log the exception
  }
票数 1
EN

Stack Overflow用户

发布于 2009-11-26 01:51:18

这就是使用ffmpeg.exe,而不是使用c#。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1605428

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档