commit ec79ce4c54810cf20d51d1a8b18bb3457552becf
parent 5ad568c4606ad2eb74819fc68e206ea85311e974
Author: Brian C. Lane <bcl@brianlane.com>
Date:   Thu, 18 Mar 2010 20:40:41 -0700
Change video sizes to tuples
In preperation for using the correct aspect ratio from mp4info switch to
a tuple of integers.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/server/scripts/makebif.py b/server/scripts/makebif.py
@@ -26,7 +26,7 @@ import shutil
 from optparse import OptionParser
 
 # for mode 0, 1, 2, 3
-videoSizes = ["240x180", "320x240", "240x136", "320x180"]
+videoSizes = [(240,180), (320,240), (240,136), (320,180)]
 
 # Extension to add to the file for mode 0, 1, 2, 3
 modeExtension = ['SD', 'HD', 'SD', 'HD']
@@ -69,7 +69,8 @@ def extractImages( videoFile, directory, interval, mode=0 ):
     @param interval interval to extract images at, in seconds
 
     """
-    cmd = "ffmpeg -i %s -r %0.2f -s %s %s/%%08d.jpg" % (videoFile, interval/100.0, videoSizes[mode], directory)
+    size = "x".join([str(i) for i in videoSizes[mode]])
+    cmd = "ffmpeg -i %s -r %0.2f -s %s %s/%%08d.jpg" % (videoFile, interval/100.0, size, directory)
     print cmd
     p = Popen( cmd, shell=True, stdout=PIPE, stdin=PIPE)
     (stdout, stderr) = p.communicate()