set keyframe interval

This commit is contained in:
j 2012-01-05 21:12:45 +05:30
parent da4e0e2c8d
commit b9ffb5e028
2 changed files with 12 additions and 6 deletions

View file

@ -500,10 +500,15 @@ class API(ox.API):
fname = fname.encode('utf-8')
while chunk:
elapsed = time.mktime(time.localtime()) - start
remaining = elapsed / (done/fsize) - elapsed
print '%0.2f%% %s of %s done, %s remaining\r' % (
100 * done/fsize, ox.formatBytes(done), ox.formatBytes(fsize),
ox.formatDuration(remaining, verbosity=2)),
if done:
remaining = int((elapsed / (done/fsize) - elapsed)/60) * 60 * 1000
remaining = ", %s remaining" % ox.formatDuration(remaining,
milliseconds=False, verbosity=2)
else:
remaining = ""
msg = '%0.2f%% %s of %s done%s' % (
100 * done/fsize, ox.formatBytes(done), ox.formatBytes(fsize), remaining)
print ''.join([msg, ' ' * (80-len(msg)), '\r']),
sys.stdout.flush()
form = ox.MultiPartForm()
form.add_file('chunk', fname, chunk)
@ -535,7 +540,7 @@ class API(ox.API):
if data and data.get('result') == 1:
done += len(chunk)
chunk = f.read(CHUNK_SIZE)
print ' '
print ' ' * 80
return data and 'result' in data and data.get('result') == 1
else:
if DEBUG:

View file

@ -130,10 +130,11 @@ def video_cmd(video, target, profile, info):
if abs(width/height - dar) < 0.02:
aspect = '%s:%s' % (width, height)
# '-g', '%d' % int(fps*2),
video_settings = [
'-vb', '%dk'%bitrate,
'-aspect', aspect,
'-g', '%d' % int(fps*5),
'-keyin_min', '%d' % int(fps*2),
'-vf', 'yadif,hqdn3d,scale=%s:%s'%(width, height),
] + extra
else: