improve frame extraction, #849

This commit is contained in:
j 2013-07-22 09:26:22 +02:00
parent 3c9bb6b94f
commit 2f9b07c03d

View File

@ -60,7 +60,12 @@ def frame(video, target, position):
return r == 0
'''
#ffmpeg
cmd = [command('ffmpeg'), '-y', '-ss', str(position), '-i', video, '-an', '-vframes', '1', target]
pre = position - 2
if pre < 0:
pre = 0
else:
position = 2
cmd = [command('ffmpeg'), '-y', '-ss', str(pre), '-i', video, '-ss', str(position), '-an', '-vframes', '1', target]
r = run_command(cmd)
return r == 0