Takes an image and creates a color-cycled mp4 accompanied by the supplied music.
Run the python code to turn the given image into 100 color cycled jpegs. First you'll need to pip install a few packages:
- pip install opencv-python
- pip install numpy
- pip install Pillow
- pip3 install progressbar2
Then run:
$ python color_cycle.py sky-diamonds.jpg
$ ffmpeg -r 10 -i sky-diamonds-%02d.jpg -vcodec mpeg4 -y movie.mp4
(r is framerate in FPS)
$ ffmpeg -loop 1 -t 439 -framerate 10 -i sky-diamonds-%02d.jpg -i song.mp3 -c copy -c:v libx264 -map 0:v:0 -map 1:a:0 output.mp4
t is the duration of the song in seconds. The "-c:v libx264" option makes it take longer but creates a much smaller output
$ rm sky-diamonds-%02d.jpg
Install imagemagick (brew install imagemagick)
convert -delay 0 -loop 0 *-??.jpg sky-diamonds.gif
https://stackoverflow.com/questions/44947505/how-to-make-a-movie-out-of-images-in-python https://video.stackexchange.com/questions/12905/repeat-loop-input-video-with-ffmpeg https://superuser.com/questions/590201/add-audio-to-video-using-ffmpeg