PHP Classes

PHP Convert Video to GIF: Convert a video file to animated GIF with giflayer

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 932 All time: 3,840 This week: 206Up
Version License PHP version Categories
giflayer 1.1GNU General Publi...5.4PHP 5, Graphics, Web services, Video
Description 

Author

This class can convert a video file to animated GIF with giflayer Web service.

It takes the URL of a given video page and the start, end or duration time of the video to be extracted.

The class sends a request to the giflayer Web service to convert the video to the GIF animation format.

The class can display the converted GIF file on a Web page or retrieve it for download.

Currently it supports converting videos given the URLs of the pages on BBC, Bloomberg Business Video, CNN, Dailymotion, Discovery, Facebook, Flickr, Fox News Video, IMDB, LiveLeak, Twitch, Twitter, Vimeo, Vine, Yahoo Screen and YouTube.

Notice that the giflayer API service has been discontinued until further notice, so this package may not work at the time you are trying it.

Picture of Dave Smith
  Performance   Level  
Name: Dave Smith is available for providing paid consulting. Contact Dave Smith .
Classes: 51 packages by
Country: United States United States
Age: 59
All time rank: 608 in United States United States
Week rank: 13 Up2 in United States United States Up
Innovation award
Innovation award
Nominee: 32x

Winner: 7x

Example

<?php
/*
example usage
gifLayer ver 1.0
*/

//disable time limit
set_time_limit(0);

//include gifLayer class
include('giflayer.class.php');

//Instantiate class with video url, start and end time in seconds
$gifLayer = new gifLayer('https://www.youtube.com/watch?v=feZKVnHXwv0',33,34);

//display html image tag for converted video
$gifLayer->displayImage();

/*
The following demonstrates the download and display from captured binary
of the converted video. To use, uncomment the captureGif method to capture
the binary and then uncomment either the downloadCapture or displayCapture
methods, depending on which you wish to preform.
*/

//$gifLayer->captureGif();

//$gifLayer->downloadCapture('test.gif');

//$gifLayer->displayCapture();
?>


Details

Class: gifLayer Version: 1.0 12/4/2015 Copyright 2015 Wagon Trader, All Rights Reserved Description: Convert web video into a GIF image using the giflayer API from www.giflayer.com. Supported video portals include... BBC, Bloomberg Business Video, CNN, Dailymotion, Discovery, Facebook, Flickr, Fox News Video, IMDB, LiveLeak, Twitch, Twitter, Vimeo, Vine, Yahoo Screen and YouTube. Files: giflayer.class.php - main class example.php - basic usage Installation: Upload files to a web accessible location on your server (eg. public_html) Configuration: You can change the following settings in the class to meet your specific needs... apiKey = Your personal API Key, get a free key at https://giflayer.com/product endpoint = The API endpoint, you will only need to change this if the API changes location. Usage: refer to example.php file for class instantiation and basic usage. refer to giflayer.class.php for instructions on using methods. Customizing the converted video: In addition to the url, start, end and duration params, you can set the following params to further customize the returned GIF. You can use the setParam method to add/change any param. size - the width and height in pixels of the GIF image. Default: size=200x300 Min: size=50x50 Max: size=5000x5000 crop - crop the image to the specified width and height in pixels. Default: none Min: crop=50x50 Max: crop=5000x5000 fps - frames per second of the generated GIF. higher is better quality. Default: fps=15 Min: fps=1 Max: fps=30 Premium accounts also have access to the following params. trailer - split the GIF image into parts for a preview. trailer=1 will split the image into 10 parts and play the first 10% of each part trailer=4,5 will split the image into 4 parts and play the first 5% of each part export - export the GIF image to a specified location export=s3://[bucket api key]:[bucket secret key]@[bucket] will export to AWS S3 bucket export=ftp://[user]:[password]@[ftp server][/path/to/folder] will upload to folder using FTP Changelog: 1.0 Initial Release

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example Usage
Plain text file giflayer.class.php Class Main Class
Accessible without login Plain text file license.txt Lic. License
Accessible without login Plain text file manual.txt Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 0%
Total:932
This week:0
All time:3,840
This week:206Up