【问题标题】:php proc_open how to detect that the command is completed / proc_open() expects at least 3 parametersphp proc_open 如何检测命令是否完成 / proc_open() 至少需要 3 个参数
【发布时间】:2016-04-10 04:06:01
【问题描述】:

这是我的代码

$descriptorspec = array( 0 => array("pipe", "r") );
$call_mp4 = "ffmpeg command ...... ";
$openMp4 = proc_open($call_mp4, $descriptorspec , $pipe);
$isMp4stillcompressing  = proc_get_status( $openMp4 );
while ( $isMp4stillcompressing['running'] ) {
    echo '• ';
}

我的“错误”是它没有尽头;(

为什么会这样?

我的主要目标是在转换时输出一个点或其他信息

谢谢

【问题讨论】:

    标签: php ffmpeg proc-open


    【解决方案1】:

    按此顺序,变量$isMp4stillcompressing 将在while 循环外设置一次,并在循环内永远保持为真。每次循环运行时都需要检查:

    $isMp4stillcompressing  = proc_get_status( $openMp4 );
    
    while ( $isMp4stillcompressing['running'] ) {
        echo '• ';
        $isMp4stillcompressing  = proc_get_status( $openMp4 );
    }
    

    【讨论】:

      猜你喜欢
      • 2011-08-06
      • 1970-01-01
      • 2021-11-25
      • 2017-02-08
      • 2016-04-17
      • 1970-01-01
      • 2023-03-28
      • 2023-03-23
      • 1970-01-01
      相关资源
      最近更新 更多