ffmpeg frame extraction, yay
This commit is contained in:
parent
a6afdc1559
commit
0de6a5c1c5
1 changed files with 6 additions and 0 deletions
|
@ -34,6 +34,7 @@ def frame(video, target, position):
|
||||||
return r == 0
|
return r == 0
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
'''
|
||||||
#mplayer
|
#mplayer
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
target = os.path.abspath(target)
|
target = os.path.abspath(target)
|
||||||
|
@ -51,6 +52,11 @@ def frame(video, target, position):
|
||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
shutil.rmtree(framedir)
|
shutil.rmtree(framedir)
|
||||||
return r == 0
|
return r == 0
|
||||||
|
'''
|
||||||
|
#ffmpeg
|
||||||
|
cmd = ['ffmpeg', '-y', '-ss', str(position), '-i', video, '-f', 'mjpeg', '-an', '-vframes', '1', target]
|
||||||
|
r = run_command(cmd)
|
||||||
|
return r == 0
|
||||||
|
|
||||||
def video(video, target, profile, info):
|
def video(video, target, profile, info):
|
||||||
if not os.path.exists(target):
|
if not os.path.exists(target):
|
||||||
|
|
Loading…
Reference in a new issue