Regift

by matthewpalmer

matthewpalmer /Regift

Easily convert a video to a GIF on iOS.

464 Stars 72 Forks Last release: over 1 year ago (1.6.0) MIT License 136 Commits 8 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Regift

Easily convert a video to a GIF on iOS and OSX.

Travis Version License Platform Carthage compatible




🚀

I also make Rocket, an app that gives you Slack-style emoji everywhere on your Mac.


Demo image of Rocket





Requirements

  • Xcode 10+
  • iOS 11.1+ / macOS 10.12+
  • Swfit 5.0+

Installation

Cocoapods

Regift is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Regift"

Carthage

Regift is available through Carthage.

github 'matthewpalmer/Regift'

Quick Start

import Regift

Synchronous GIF creation:

let videoURL   = ...
let frameCount = 16
let delayTime  = Float(0.2)
let loopCount  = 0    // 0 means loop forever

let regift = Regift(sourceFileURL: videoURL, frameCount: frameCount, delayTime: delayTime, loopCount: loopCount) print("Gif saved to (regift.createGif())")

let startTime = Float(30) let duration = Float(15) let frameRate = 15

let trimmedRegift = Regift(sourceFileURL: URL, startTime: startTime, duration: duration, frameRate: frameRate, loopCount: loopCount) print("Gif saved to (trimmedRegift.createGif())")

Asynchronous GIF creation:

let videoURL   = ...
let frameCount = 16
let delayTime  = Float(0.2)
let loopCount  = 0    // 0 means loop forever

Regift.createGIFFromSource(videoURL, frameCount: frameCount, delayTime: delayTime) { (result) in print("Gif saved to (result)") }

let startTime = Float(30) let duration = Float(15) let frameRate = 15

Regift.createGIFFromSource(videoURL, startTime: startTime, duration: duration, frameRate: frameRate) { (result) in print("Gif saved to (result)") }

Acknowledgements

Thanks to Rob Mayoff's Gist, without which this library wouldn't exist.

My personal thanks to all of Regift’s contributors:

  • caughtinflux
  • samuelbeek
  • sebyddd
  • nakajijapan
  • dbburgess

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.