Created
February 16, 2017 11:23
-
-
Save yurenju/b2576617d15f41200e142f8d39e2f377 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
require('shelljs/global'); | |
var filename = process.argv[2]; | |
// mediainfo --Output="Video;%Width%x%Height%" multiple-gradient.mov | |
var output = exec('mediainfo --Output="Video;%Width%x%Height%" ' + filename, {silent: true}).output | |
var matched = /(\d+)x(\d+)/.exec(output); | |
exec('ffmpeg -i ' + filename + ' -s ' + parseInt(matched[1])/2 + 'x' + parseInt(matched[2])/2 + ' -pix_fmt rgb24 -r 18 -f gif - | gifsicle --optimize=3 --delay=3 > ' + filename.split('.')[0] + '.gif') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment