protected function parseEncoder($lines) {
    $encoders = array();
    foreach ($lines as $line) {
      if (preg_match('/^\s+([A-Z .]+)\s+(\w{2,})\s+(.*)$/', $line, $m)) {
        $type = trim($m[1]);
        if (strpos($type, 'E') !== false) {
          $encoder = trim($m[2]);
          if (strpos($encoder, ',') !== false) {
            foreach (split(',', $encoder) as $e) {
              $encoders[] = $e;
            }
          } else {
            $encoders[] = $encoder;
          }
        }
      }
    }

    sort($encoders);
    return $encoders;
  }
protected function parseEncoder($lines) {
    $encoders = array();
    foreach ($lines as $line) {
      if (preg_match('/^\s+([A-Z .]+)\s+(\w{2,})\s+(.*)$/', $line, $m)) {
        $type = trim($m[1]);
        if (strpos($type, 'E') !== false) {
          $encoder = trim($m[2]);
          if (strpos($encoder, ',') !== false) {
            foreach (split(',', $encoder) as $e) {
              $encoders[] = $e;
            }
          } else {
            $encoders[] = $encoder;
          }
        }
      }
    }

    sort($encoders);
    return $encoders;
  }
protected function parseEncoder ( $ lines ) { $ encoders = array ( ) ; foreach ( $ lines as $ line ) { if ( preg_match ( '/^\s+([A-Z .]+)\s+(\w{2,})\s+(.*)$/' , $ line , $ m ) ) { $ type = trim ( $ m [ 1 ] ) ; if ( strpos ( $ type , 'E' ) !== false ) { $ encoder = trim ( $ m [ 2 ] ) ; if ( strpos ( $ encoder , ',' ) !== false ) { foreach ( split ( ',' , $ encoder ) as $ e ) { $ encoders [ ] = $ e ; } } else { $ encoders [ ] = $ encoder ; } } } } sort ( $ encoders ) ; return $ encoders ; }
Extract encoder names from output lines

@param array $lines ffmpeg output lines
@return array List of supported encoders
Extract encoder names from output lines