PHP code example of jeankassio / videotogif

1. Go to this page and download the library: Download jeankassio/videotogif library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jeankassio / videotogif example snippets


use JeanKassio\VideoToGif;
  
  $converter = new VideoToGif();
  
  $b64 = "data:video/mp4;base64,AAAAGGZ0eXBtcDQyAAAAAGlzb2...";
  
  $result = $converter->convert($b64);

  var_dump($result);


array(4) { 
  ["gif"]=> string(304970) "data:image/gif;base64,R0lGODlhkAGWAfcAAD4AND4UPUMHN1YBNEkUO1UYPGUWO1cl..." (Hidden to save on reading)
  ["fps"]=> int(29) 
  ["width"]=> int(400) 
  ["height"]=> int(406) 
}