improve frame extraction, #849
This commit is contained in:
parent
3c9bb6b94f
commit
2f9b07c03d
1 changed files with 6 additions and 1 deletions
|
@ -60,7 +60,12 @@ def frame(video, target, position):
|
||||||
return r == 0
|
return r == 0
|
||||||
'''
|
'''
|
||||||
#ffmpeg
|
#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)
|
r = run_command(cmd)
|
||||||
return r == 0
|
return r == 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue