在 C# 中使用 ffmpeg.exe 将 MPG 转换为 AVI
我在将 MPG 文件转换为 AVI 文件时遇到问题。当我转换文件时,例如 520KB MPG 文件,我的程序生成了大约 112MB 的 AVI 文件,并且该视频无法正常工作。什么会导致这种情况呢?
string path = "C:\\convert\\input.mpg"
string outputpath = "C:\\convert\\"+output+".avi";
string fileargs = "-i" + " " + path + " " + outputpath;
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "C:\\convert\\ffmpeg.exe";
p.StartInfo.Arguments = fileargs;
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
p.WaitForExit();
I have a problem converting an MPG file to an AVI file. When I converted a file, for example 520KB MPG file, my program generated an AVI file of about 112MB and that video does not work properly. What would cause this?
string path = "C:\\convert\\input.mpg"
string outputpath = "C:\\convert\\"+output+".avi";
string fileargs = "-i" + " " + path + " " + outputpath;
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "C:\\convert\\ffmpeg.exe";
p.StartInfo.Arguments = fileargs;
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
p.WaitForExit();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我用它来重新包装 Quicktime。不确定它在 AVI 上是否能正常工作,但你可以尝试一下。
或者,如果这不起作用,您可以尝试:
I have used this for Quicktime rewrapping. Not sure it will work as fine on AVI but you could have a go.
or, if that doesn't work, you could try:
ffmpeg 有很多选项。可能需要一些实验才能获得正确的设置。
ffmpeg has many options. It will probably take some experimentation to get the correct settings.