Skip to content

Instantly share code, notes, and snippets.

@arirusso arirusso/gifmp3.sh
Last active Dec 22, 2015

Embed
What would you like to do?
Create a quicktime movie that combines a looping animated gif with an mp3. The resulting movie will be the same length as the audio file.
#!/bin/sh
#
# Create a quicktime movie that combines a looping animated gif with an mp3. The resulting movie will
# be the same length as the audio file.
#
if [ $(( $# - $OPTIND )) -lt 4 ]; then
echo "Usage: $0 input.gif input.mp3 output.mov [framerate] [resolution]"
exit 1
fi
mkdir /tmp/gifmp3
convert $1 /tmp/gifmp3/frame%05d.png
ffmpeg -i $2 -f image2 -loop 1 -i /tmp/gifmp3/frame%05d.png -r $4 -s $5 -c:v libx264 -crf 18 -tune stillimage -preset medium -shortest $3
rm -rf /tmp/gifmp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.