Fix getBinary
This commit is contained in:
		
					parent
					
						
							
								7f3d76c5fe
							
						
					
				
			
			
				commit
				
					
						f567f31602
					
				
			
		
					 3 changed files with 5 additions and 12 deletions
				
			
		|  | @ -59,7 +59,7 @@ abstract class Binary implements AdapterInterface | ||||||
|         $binary = null; |         $binary = null; | ||||||
| 
 | 
 | ||||||
|         foreach (static::getBinaryName() as $candidate) { |         foreach (static::getBinaryName() as $candidate) { | ||||||
|             if (null !== $binary = $finder->find(static::getBinaryName())) { |             if (null !== $binary = $finder->find($candidate)) { | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -174,7 +174,7 @@ class FFMpeg extends Binary | ||||||
|      * @return \FFMpeg\FFMpeg |      * @return \FFMpeg\FFMpeg | ||||||
|      * @throws Exception\RuntimeException |      * @throws Exception\RuntimeException | ||||||
|      */ |      */ | ||||||
|     protected function encodeVideo(Format\VideoFormat $format, $outputPathfile, $threads, $control) |     protected function encodeVideo(Format\VideoFormat $format, $outputPathfile, $threads) | ||||||
|     { |     { | ||||||
|         $cmd_part1 = $this->binary |         $cmd_part1 = $this->binary | ||||||
|             . ' -y -i ' |             . ' -y -i ' | ||||||
|  | @ -209,14 +209,7 @@ class FFMpeg extends Binary | ||||||
|             $process = new Process($pass); |             $process = new Process($pass); | ||||||
| 
 | 
 | ||||||
|             try { |             try { | ||||||
| //                $process->run();
 |                 $process->run(); | ||||||
|                 $process->run(function($data, $dodo) { |  | ||||||
| //                    echo $data.$dodo."\nend chunk\n";
 |  | ||||||
|                         $matches = array(); |  | ||||||
|                         preg_match('/time=([0-9:\.]+)/', $dodo, $matches); |  | ||||||
|                         if ($matches[1]) |  | ||||||
|                             var_dump($matches); |  | ||||||
|                     }); |  | ||||||
|             } catch (\RuntimeException $e) { |             } catch (\RuntimeException $e) { | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|  | @ -43,7 +43,7 @@ class BinaryTester extends Binary | ||||||
| 
 | 
 | ||||||
|     protected static function getBinaryName() |     protected static function getBinaryName() | ||||||
|     { |     { | ||||||
|         return 'php'; |         return array('php'); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  | @ -53,7 +53,7 @@ class BinaryTesterWrongBinary extends Binary | ||||||
| 
 | 
 | ||||||
|     protected static function getBinaryName() |     protected static function getBinaryName() | ||||||
|     { |     { | ||||||
|         return ''; |         return array(''); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue