Skip to content

Instantly share code, notes, and snippets.

A flawless way whereyou can just spit gifs out images, video, very easy. Mac only :(
----------- 1 ----------------
-First you need to open Terminal.app
(Spotlight > terminal)
- past this in and press enter: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
(this command install a package manager that lets you install two packages into your machine; they're not too big >.< )
----------- 2 ----------------
@samelie
samelie / ffmpeg last frame video
Created February 18, 2015 09:49
ffmpeg last frame of video
#!/bin/bash
fn="$1"
of=`echo $1 | sed s/mp4/jpg/`
lf=`ffprobe -show_streams "$fn" 2> /dev/null | grep nb_frames | head -1 | cut -d \= -f 2`
rm -f "$of"
let "lf = $lf - 1"
ffmpeg -i $fn -vf select=\'eq\(n,$lf\) -vframes 1 $of
@samelie
samelie / gif!
Last active August 29, 2015 14:13
make gifs from video
//to folder output
ffmpeg -i screencast.mov -vf scale=320:-1 -r 4 output/ffout%3d.png
//make jpg
for i in output/*.png; do convert $i -strip -interlace Plane -gaussian-blur 0.01 -quality 70% $i.jpg; done
// merge, -dalay' is the delay of 8, you would get a FPS=100/8=12.5
convert -delay 6 -loop 0 output/*.jpg output/animation.gif
@samelie
samelie / imagemagik
Last active October 17, 2015 16:32
resize imagemagik
for i in *.png; do convert $i -resize 480x270 $i; done
for i in *.mp4; do ffmpeg -i $i -c:v libvpx -minrate 3M -maxrate 3M -b:v 3M -c:a libvorbis $i.webm; done
@samelie
samelie / recursive png compression
Last active August 29, 2015 14:10
Recursive png smash
for i in *.png; do pngquant --force --ext .png --quality=90-100 $i; done
@samelie
samelie / ffmpeg install brew
Created September 2, 2014 21:35
ffmpeg all options in brew
change owner of brew to root, which is common for files in /usr/local directory ( opposed to either /home or /Users )
sudo chown root /usr/local/bin/brew
and/or add the admin group
sudo chown root:admin /usr/local/bin/brew
sudo brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-openssl --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools --with-x265 --with-faac --with-lame --with-x264 --with-xvid