Coder Social home page Coder Social logo

regift's Introduction

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 9+
  • Swfit 4.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

regift's People

Contributors

matthewpalmer avatar nakajijapan avatar dbburgess avatar balestrapatrick avatar caughtinflux avatar dehlen avatar gbarcena avatar samuelbeek avatar krisyu avatar sebyddd avatar

Stargazers

Kyle Howells avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.