I'm trying to make a video using a series of .png images. I found this Python script, but I am not entirely sure on how to use it:
https://sites.google.com/site/timelapsepy/home
I also tried to look into opencv, but it doesn't seem to install properly for me. Any ideas on a simple program to string several images together to create a time-lapse video? I would like to use Python for this if possible.
INSTALLATION. PyPNG is pure Python and has no dependencies. It requires Python 3.5 or any compatible higher version. to access the png module in your Python program.
If you really need a scripted python solution, you can look into using PIL
But if you just want to easily convert a sequence of png images to a movie, you can simply use ffmpeg:
ffmpeg -f image2 -r 1/5 -i image%05d.png -vcodec mpeg4 -y movie.mp4
This command takes images with 5 digit padding (image00001.png) and compresses them into an mpeg4 quicktime, at a rate of holding each frame for 5 seconds. You could do a different fps if your images are greater: -r 24
(24 frames per second)
Instead of ffmpeg, you might want to use avconv
avconv -f image2 -i figMatplotlib%d.png -r 76 -s 800x600 foo.avi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With