From: yomguy Date: Wed, 28 Jul 2010 14:32:13 +0000 (+0000) Subject: bug fix X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=691cccc5656c685b983f16178ed9ba6ab041826c;p=yomguy-tools.git bug fix git-svn-id: http://svn.parisson.org/svn/tools/trunk@116 457c0346-1240-4656-8a5a-9edca8063506 --- diff --git a/isp_tools/isp_trans.py b/isp_tools/isp_trans.py index f204f27..12ea007 100644 --- a/isp_tools/isp_trans.py +++ b/isp_tools/isp_trans.py @@ -148,8 +148,8 @@ class ISPTrans(object): self.format = 'flv' self.size = '480x270' - self.vb = '288k' - self.ab = '96k' + self.vb = '336k' + self.ab = '64k' self.ar = '44100' self.async = '500' @@ -176,8 +176,10 @@ class ISPTrans(object): #command = 'ffmpeg -ss %s -t %s -i %s -vhook "/usr/lib/vhook/watermark.so -f %s" -f %s -s %s -vb %s -acodec libmp3lame -ab %s -ar %s -async %s -y %s &' % (start_time, duration, source_file, self.water_img, self.format, self.size, self.vb, self.ab, self.ar, self.async, dest_file) # normal - command = 'ffmpeg -ss %s -t %s -i %s -f %s -s %s -vb %s -acodec libmp3lame -ab %s -ar %s -async %s -y %s & ' % (start_time, duration, source_file, self.format, self.size, self.vb, self.ab, self.ar, self.async, dest_file) - + if duration == '-1': + command = 'ffmpeg -ss %s -i %s -f %s -s %s -vb %s -acodec libmp3lame -ac 1 -ab %s -ar %s -async %s -y %s & ' % (start_time, source_file, self.format, self.size, self.vb, self.ab, self.ar, self.async, dest_file) + else: + command = 'ffmpeg -ss %s -t %s -i %s -f %s -s %s -vb %s -acodec libmp3lame -ac 1 -ab %s -ar %s -async %s -y %s & ' % (start_time, duration, source_file, self.format, self.size, self.vb, self.ab, self.ar, self.async, dest_file) return command def process(self): @@ -194,13 +196,16 @@ class ISPTrans(object): os.makedirs(dest_dir) dest = dest_dir + os.sep + name + '.' + self.format - start_mn = source_dict['start_mn'] - start_s = source_dict['start_s'] - end_mn = source_dict['end_mn'] - end_s = source_dict['end_s'] - start = int(60 * float(start_mn) + float(start_s)) - end = 60 * float(end_mn) + float(end_s) - duration = int(end - start) + start_mn = int(float(source_dict['start_mn'])) + start_s = int(float(source_dict['start_s'])) + end_mn = int(float(source_dict['end_mn'])) + end_s = int(float(source_dict['end_s'])) + start = int(60 * start_mn + start_s) + if end_mn == -1 or end_s == -1: + duration = -1 + else: + end = 60 * end_mn + end_s + duration = int(end - start) force_mode = source_dict['force'] if not os.path.exists(media):