Created
June 9, 2017 15:12
-
-
Save ibaaj/fec3fe71afbd435d52e80d7990cf38ce to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/zsh | |
rm -rf ./frames ./ftop ./fbottom ./final; | |
mkdir -p {frames,ftop,fbottom,final}; | |
ffmpeg -i IMG_6501.MOV -r 25 -qscale:v 2 frames/%05d.jpg ; | |
framesNumber=$(ls ./frames/*.jpg |wc -l|tr -d ' '); | |
C_H=540 | |
H=1080 | |
H_D=$((H - C_H)); | |
for i in {1..${framesNumber}} | |
do | |
nb=$(printf %05d ${i}); | |
convert frames/${nb}.jpg -crop 1920x${H_D}+0+${C_H} fbottom/${nb}.jpg; | |
convert fbottom/${nb}.jpg -flip ftop/${nb}.jpg; | |
convert fbottom/${nb}.jpg ftop/${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