Skip to content

Instantly share code, notes, and snippets.

@camb416
Created June 12, 2015 21:47
Show Gist options
  • Save camb416/4c3bf33b9418583527e2 to your computer and use it in GitHub Desktop.
Save camb416/4c3bf33b9418583527e2 to your computer and use it in GitHub Desktop.
make triangles for hexoscope
#!/bin/bash
mkdir frames
ffmpeg -i $1 -f image2 frames/image-%4d.png
convert -size 1280x720 xc:black \
-fill white \
-stroke none \
-draw "path 'M 640 0 L 224 720 L 1055 720 z' " \
mask.gif
# rotate it (optional)
mogrify -rotate 180 mask.gif
for i in frames/*
do
if test -f "$i"
then
echo "converting $i to ${i//image/tri}"
#echo "to ${i//image/tri}"
convert $i mask.gif -alpha Off -compose CopyOpacity -composite -rotate 180 -crop 830x720+224+0 ${i//image/tri}
fi
done
#ffmpeg -f image2 -i output-%4d.png -pix_fmt yuv420p -r 30 output_whole.mov
## trim da music
#ffmpeg -i Bonehead.mp3 -ss 0 -t 75 musicshort2.wav
# add the music
#ffmpeg -i musicshort2.wav -i output_whole.mov final_whole.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment