Last active
December 22, 2015 13:29
-
-
Save arirusso/6479443 to your computer and use it in GitHub Desktop.
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.
This file contains hidden or 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/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