Skip to content

Instantly share code, notes, and snippets.

@ibaaj
Created May 9, 2016 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ibaaj/6505a5df5df64ab4cc850a1e47b7073b to your computer and use it in GitHub Desktop.
Save ibaaj/6505a5df5df64ab4cc850a1e47b7073b to your computer and use it in GitHub Desktop.
A71 "surfing the clouds"
#!/bin/zsh
mkdir -p {frames,ftop,fbottom,final};
ffmpeg -i IMG_7197.mov -r 25 -qscale:v 2 frames/%05d.jpg ;
framesNumber=$(ls ./frames/*.jpg |wc -l|tr -d ' ');
C_H=540
H=1280
H_D=$((H - C_H));
for i in {1..${framesNumber}}
do
nb=$(printf %05d ${i});
convert frames/${nb}.jpg -flip -crop 720x${H_D}+0+${C_H} fbottom/${nb}.jpg;
convert frames/${nb}.jpg -crop 720x${H_D}+0+0 ftop/${nb}.jpg;
convert ftop/${nb}.jpg fbottom/${nb}.jpg -append final/${nb}.jpg;
done
#convert -layers Optimize frames/*.jpg out.gif;
cat ./final/*.jpg | ffmpeg -f image2pipe -r 25 -vcodec mjpeg -i - -vcodec libx264 out-${C_H}.mp4;
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment