forked from chraibi/cellular_automata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_movie.py
30 lines (22 loc) · 806 Bytes
/
make_movie.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from sys import platform as _platform
import os
def make_movie(direct):
files = os.path.join(direct, '*.png')
cmd = '"mf://%s" -mf w=800:h=600:fps=2:type=png -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o output.avi' % files
os.system("mencoder %s" % cmd)
def make_movie_win(direc):
print ('Windows not yet done!')
def make_movie_osx(direct):
print ('OSX not yet done!')
if __name__ == "__main__":
directory = 'pngs'
if not os.path.exists(directory):
os.mkdir(directory)
if _platform == "linux" or _platform == "linux2":
make_movie(directory)
elif _platform == "darwin":
make_movie_osx(directory)
elif _platform == "win32" or _platform == "cygwin":
make_movie_win(directory)
else:
print('%s not known!' % _platform)