]> git.parisson.com Git - telemeta.git/commitdiff
fix transcode script
authorGuillaume Pellerin <yomguy@parisson.com>
Sat, 22 Jun 2013 21:26:23 +0000 (23:26 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Sat, 22 Jun 2013 21:26:23 +0000 (23:26 +0200)
tools/scripts/transcode/transcode.py

index 074fd113d7fca74debe6075153e959af54e05f77..ad4e924b5bb2cfee3146152a720021ebc5350380 100755 (executable)
@@ -19,16 +19,16 @@ class Logger:
 source_format = 'webm'
 preview_tc = '00:00:05'
 
-ffmpeg_args = {'mp3' : ' -i %i -vn -acodec libmp3lame -aq 6 -ac 1',
-               'ogg' : ' -i %i -vn -acodec copy',
-               'mp4' : ' -i %i -vcodec libx264 -r 24 -b 512k -threads 6 -acodec libfaac -ar 48000 -ab 96k -ac 1',
-               'png' : ' -ss ' + preview_tc + '-i %i',
+ffmpeg_args = {'mp3' : '-i %s -vn -acodec libmp3lame -aq 6 -ac 1',
+               'ogg' : '-i %s -vn -acodec copy',
+               'mp4' : '-i %s -vcodec libx264 -r 24 -b 512k -threads 6 -acodec libfaac -ar 48000 -ab 96k -ac 1',
+               'png' : '-ss ' + preview_tc + ' -i %s',
               }
 
-logger = Logger(log_file)
 args = sys.argv[1:]
 log_file = args[-1]
 root_dir = args[-2]
+logger = Logger(log_file)
 
 for root, dirs, files in os.walk(root_dir):
     for file in files:
@@ -40,7 +40,7 @@ for root, dirs, files in os.walk(root_dir):
                 dest = os.path.abspath(root + os.sep + local_file)
                 local_files = os.listdir(root)
                 if not local_file in local_files or '--force' in args:
-                    command = ffmpeg_args[format] % path + ' -y ' + dest
+                    command = 'ffmpeg ' + ffmpeg_args[format] % path + ' -y ' + dest
                     logger.logger.info(command)
                     if not '--dry-run' in args:
                         os.system(command)