Create a gist now

Instantly share code, notes, and snippets.

4panel movie maker script
#Script to make multi frame movies.
# how to export to frames:
# ffmpeg -i yourmovie.avi -sameq ../Outputdir/frame%4d.jpg
# or use -f image2 as export option.
# names the frames as frame0001.jpg, frame0002.jpg, etc.
# for long movies use %5d.jpg
#choose four prefixes
DA="gow";
DB="wav";
DC="twp";
DD="car";
# for four digit numbers with leading zeroes, counter needs to start as five digit #
# then remove the left most digit.
counter=10000
# for f in $DF/*.jpeg; do
for f in ${DA}*.jpg; do
let "counter+=1"
#foo=cam${counter:1}.jpeg
montage -geometry 480x360 ${DA}${counter:1}.jpg ${DB}${counter:1}.jpg ${DC}${counter:1}.jpg ${DD}${counter:1}.jpg ./montage${counter:1}.jpg
done
ffmpeg -r 30 -sameq -i montage%04d.jpg ../4panelwater.mp4
# add audio
# ffmpeg -i 4panelwater.mp4 -sameq -i water.mp3 -ab 192k 4panelout.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment