【发布时间】:2012-07-06 15:32:24
【问题描述】:
我在 C# Windows 窗体应用程序中调用 FFMpeg。由于它使用了如此多的 CPU(几乎 100%),我的线程都无法继续工作。有没有办法限制这种 CPU 使用率?
下面是我的工作代码,
Process ffmpeg = new Process();
ffmpeg.StartInfo.UseShellExecute = false;
ffmpeg.StartInfo.FileName = '..\ffmpeg.exe'
ffmpeg.StartInfo.CreateNoWindow = true;
ffmpeg.Start();
我尝试将 Process.PriorityClass 设置为 PriorityClass.BelowNormal 但这完全阻止了 ffmpeg 进程。
还有其他出路吗?
【问题讨论】:
-
你说得对,但我该如何使用 -threads 参数?我找不到合适的教程来实现 -threads。
-
您将 -threads 作为参数传递给 FFMPeg。我很快就会发布一个例子。
标签: c# performance ffmpeg