【发布时间】:2013-05-17 15:30:50
【问题描述】:
我在 Windows 7 上,使用 WampServer,并尝试使用 FFMPEG。
编码有效,但我无法从 exec() 中获取进程 ID
方法也不是shell_exec() 方法。
这是我的代码:
$cmd = C:\ffmpeg\bin\ffmpeg.exe -i "C:\...\4ch.wav" -ar 44100 -ab 48000 -f mp3 -y "C:\...\enc_4ch.mp3"
这就是我试图用 shell_exec 做的:
shell_exec("nohup $cmd > /dev/null & echo $!");
并与 exec :
exec("nohup " . $this->_command . " > /dev/null 2>/dev/null &") ; // returns null
exec("nohup " . $this->_command . " > /dev/null 2>&1 &"); // also returns null
请让我知道我做错了什么,因为我想稍后使用以下方法检查我的进程是否仍在运行:
private function is_process_running($proccess_id)
{
exec("ps $proccess_id", $process_state);
return (count($process_state) >= 2);
}
谢谢你
【问题讨论】:
标签: php windows ffmpeg shell-exec pid