项目需求:用户上传视频格式的文件,需要转为指定编码的MP4格式(为了适应在线播放),并且截取视频的第一帧作为封面图片(用于展示)

实现:

1.下载ffmpeg.exe

地址:http://ffmpeg.org/

 

2.主要代码

System.Diagnostics.ProcessStartInfo FilestartInfo = new System.Diagnostics.ProcessStartInfo(“ffmpeg.exe的路径”);
FilestartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
FilestartInfo.Arguments = " 参数  -i -s等";//设置参数、截图输出路径等
System.Diagnostics.Process ps
= new System.Diagnostics.Process(); ps.StartInfo = FilestartInfo; ps.Start();

...
Dispose();

 

相关文章:

  • 2021-07-31
  • 2021-12-26
  • 2022-12-23
  • 2021-08-06
  • 2022-02-19
  • 2021-05-31
  • 2021-08-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-03-09
  • 2022-12-23
  • 2021-08-31
  • 2022-02-14
相关资源
相似解决方案