Skip to content

Instantly share code, notes, and snippets.

@fapestniegd
Last active December 15, 2015 23:39
Show Gist options
  • Save fapestniegd/5342301 to your computer and use it in GitHub Desktop.
Save fapestniegd/5342301 to your computer and use it in GitHub Desktop.
new method
#!/bin/bash
# rotate it 90 degrees
mencoder -vf rotate=1 -o rotated.avi -oac pcm -ovc lavc IMG_6259.MOV
# stabalize the jitter because james can't hold a camera stable
transcode -J stabilize --mplayer_probe -i rotated.avi && \
transcode -J transform --mplayer_probe -i rotated.avi -y raw -o stabilized.avi
# crop it
mencoder -o cropped.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 \
-vf crop=600:900:180:320,scale=120:180 stabilized.avi
mencoder -o cropped.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 \
-vf crop=600:900:180:320,scale=120:180 stabilized.avi
# write out as images
ffmpeg -i cropped.avi image%3d.png
# duplicate frames 235 to 1 in reverse order
for n in $(seq -w 1 235); do
m=$(expr 235 + $(expr 236 - $n))
cp image$n.png image$m.png;
done
# convert to animated gif that loops once
convert -delay 5 -loop 1 *.png once.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment