mudzakkir

php-ffmpeg

Aug 31st, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2.  
  3. $command='C:\program\ffmpeg.exe -i C:\wamp\www\Project\video\last-child.mp4 -f image2 -vframes 1 C:\wamp\www\Project\thumb\last-child.jpg';
  4. if(Execute($command, $output) != 0)
  5. {
  6.     die($output);
  7. }else{
  8.     echo 'video created!';
  9. }
  10.  
  11.  function Execute($command, &$output)
  12. {
  13.      $out = array();
  14.      $ret = -1;
  15.  
  16.      exec($command." 2>&1",$out,$ret);        
  17.  
  18.      foreach($out as $line)
  19.      {
  20.         $output.= $line;
  21.      }
  22.      return $ret;            
  23. }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment