我在C#Windows窗体应用程序中调用FFMpeg.由于它使用了这么多的CPU(总是超过90%),我的线程都无法继续工作.有没有办法限制这种CPU使用率?
我试图将Process.PriorityClass设置为PriorityClass.BelowNormal,但这完全阻止了ffmpeg进程.
我确信有一种方法可以做到这一点,因为我看到很多程序都使用ffmpeg.
请帮忙.
我已经使用Interop.cs成功地将IMAPI2集成到我的应用程序中.我可以毫无问题地刻录CD/DVD.但是,MsftDiscFormat2Data更新的事件处理程序不起作用,因此我无法使我的进度条移动.
这是我在codeproject网站上找到的代码:
private void backgroundBurnWorker_DoWork(object sender,DoWorkEventArgs e){MsftDiscRecorder2 discRecorder = null; MsftDiscFormat2Data discFormatData = null;
try
{
//
// Create and initialize the IDiscRecorder2 object
//
discRecorder = new MsftDiscRecorder2();
var burnData = (BurnData)e.Argument;
discRecorder.InitializeDiscRecorder(burnData.uniqueRecorderId);
//
// Create and initialize the IDiscFormat2Data
//
discFormatData = new MsftDiscFormat2Data
{
Recorder = discRecorder,
ClientName = ClientName,
ForceMediaToBeClosed = _closeMedia
};
//
// Set the verification level
//
var burnVerification = (IBurnVerification)discFormatData;
burnVerification.BurnVerificationLevel = _verificationLevel;
//
// Check if media is blank, (for RW …Run Code Online (Sandbox Code Playgroud) 我不知道为什么这么复杂,但我想要做的就是当用户在Ubercart中更改付款方式时,在我的订单中添加一个订单项.我设法通过在我的付款方式中添加以下行来完成此操作.
uc_order_line_item_add($ order-> order_id,'门口付款','门口付款',5);
这似乎添加了订单项,但订单总数未更新.当我刷新页面时,我可以看到在那里添加的订单项.显然,我不想刷新屏幕,我希望在我的付款方式回调期间显示新的订单总额和订单项.我想这可以通过调用jquery来实现,但我在Google中找不到任何有用的东西.
有人可以帮忙吗?
我认为C#进程类在作为参数传递时有接受<或>字符的问题.
当我调用以下代码时,可执行文件返回一个错误,指示我传递了多个参数.
proc = new Process();
proc.StartInfo.FileName = this.spumux.SpumuxExe;
proc.StartInfo.Arguments = "menu.xml < menu.mpg > newmenu.mpg";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = true;
proc.EnableRaisingEvents = true;
proc.OutputDataReceived += new DataReceivedEventHandler(OutputHandler);
proc.ErrorDataReceived += new DataReceivedEventHandler(OutputHandler);
proc.Exited += new EventHandler(ProcExited);
proc.Start();
proc.BeginOutputReadLine();
proc.BeginErrorReadLine();
Run Code Online (Sandbox Code Playgroud)
这段代码通常与我到目前为止尝试过的其他所有可执 因此它必须做的东西<,>人物
有任何想法吗?