$this->reportProgress(25);
//然后调用伟大的python代码生成视频
$this->logDebug($this->sellerNick, __METHOD__, '执行shell脚本', 'python ' . $this->PYTHON_PROG . ' ' . $tmp_path);
$i = 0;
while ($i < 3) {
$shell_output = shell_exec('python ' . $this->PYTHON_PROG . ' ' . $tmp_path);
if (file_exists($tmp_path . '/clips.avi')) {
break;
} else {
$i++;
}
}
if (!file_exists($tmp_path . '/clips.avi')) {
$this->logDebug($this->sellerNick, __METHOD__, '运行python生成视频失败' . $tmp_path . '/clips.avi', $shell_output);
//文件不存在,那么直接报错好了
$this->cleanTempDir($tmp_path);
throw new VideonotexistsException(500, '生成视频时发生错误', 500, '加载视频效果时发生错误,请联系客服解决');
}