set keyframe interval
This commit is contained in:
parent
da4e0e2c8d
commit
b9ffb5e028
2 changed files with 12 additions and 6 deletions
|
@ -500,10 +500,15 @@ class API(ox.API):
|
||||||
fname = fname.encode('utf-8')
|
fname = fname.encode('utf-8')
|
||||||
while chunk:
|
while chunk:
|
||||||
elapsed = time.mktime(time.localtime()) - start
|
elapsed = time.mktime(time.localtime()) - start
|
||||||
remaining = elapsed / (done/fsize) - elapsed
|
if done:
|
||||||
print '%0.2f%% %s of %s done, %s remaining\r' % (
|
remaining = int((elapsed / (done/fsize) - elapsed)/60) * 60 * 1000
|
||||||
100 * done/fsize, ox.formatBytes(done), ox.formatBytes(fsize),
|
remaining = ", %s remaining" % ox.formatDuration(remaining,
|
||||||
ox.formatDuration(remaining, verbosity=2)),
|
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()
|
sys.stdout.flush()
|
||||||
form = ox.MultiPartForm()
|
form = ox.MultiPartForm()
|
||||||
form.add_file('chunk', fname, chunk)
|
form.add_file('chunk', fname, chunk)
|
||||||
|
@ -535,7 +540,7 @@ class API(ox.API):
|
||||||
if data and data.get('result') == 1:
|
if data and data.get('result') == 1:
|
||||||
done += len(chunk)
|
done += len(chunk)
|
||||||
chunk = f.read(CHUNK_SIZE)
|
chunk = f.read(CHUNK_SIZE)
|
||||||
print ' '
|
print ' ' * 80
|
||||||
return data and 'result' in data and data.get('result') == 1
|
return data and 'result' in data and data.get('result') == 1
|
||||||
else:
|
else:
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
|
|
|
@ -130,10 +130,11 @@ def video_cmd(video, target, profile, info):
|
||||||
if abs(width/height - dar) < 0.02:
|
if abs(width/height - dar) < 0.02:
|
||||||
aspect = '%s:%s' % (width, height)
|
aspect = '%s:%s' % (width, height)
|
||||||
|
|
||||||
# '-g', '%d' % int(fps*2),
|
|
||||||
video_settings = [
|
video_settings = [
|
||||||
'-vb', '%dk'%bitrate,
|
'-vb', '%dk'%bitrate,
|
||||||
'-aspect', aspect,
|
'-aspect', aspect,
|
||||||
|
'-g', '%d' % int(fps*5),
|
||||||
|
'-keyin_min', '%d' % int(fps*2),
|
||||||
'-vf', 'yadif,hqdn3d,scale=%s:%s'%(width, height),
|
'-vf', 'yadif,hqdn3d,scale=%s:%s'%(width, height),
|
||||||
] + extra
|
] + extra
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue