I'm trying to make a gif out of a sequence of png format pics with python language in ubuntu 12.04. I have a file which my pictures are in it. they are named as, lip_shapes1.png to lip_shapes11.png. also I have a list with names of images in it which i want to make that gif in this sequence. the list looks like this:
list = [lip_shapes1.png, lip_shapes4.png , lip_shapes11.png, lip_shapes3.png]
but my problem is that i found this code :
import os
os.system('convert -loop 0 lip_shapes*.gnp anime.gif')
but it only makes gif in the order of the gnp's names, but I want it to be in any order I want. is it possible?
if anybody can help me i really appreciate it.
thanks in advance
PS: i also want to make a movie out of it. i tried this code(shapes is my list of images names):
s = Popen(['ffmpeg', '-f', 'image2', '-r', '24', '-i'] + shapes + ['-vcodec', 'mpeg4', '-y', 'movie.mp4'])
s.communicate()
but it gives me this in terminal and doesnt work:
The ffmpeg program is only provided for script compatibility and will be removed in a future release. It has been deprecated in the Libav project to allow for incompatible command line syntax improvements in its replacement called avconv (see Changelog for details). Please use avconv instead.
Input #0, image2, from 'shz8.jpeg': Duration: 00:00:00.04, start: 0.000000, bitrate: N/A Stream #0.0: Video: mjpeg, yuvj420p, 266x212 [PAR 1:1 DAR 133:106], 24 tbr, 24 tbn, 24 tbc
shz8.jpeg is the first name on the list.
thanks