ffmpeg frame extraction, yay

This commit is contained in:
j 2011-08-23 21:20:01 +02:00
parent a6afdc1559
commit 0de6a5c1c5

View file

@ -34,6 +34,7 @@ def frame(video, target, position):
return r == 0
'''
'''
#mplayer
cwd = os.getcwd()
target = os.path.abspath(target)
@ -51,6 +52,11 @@ def frame(video, target, position):
os.chdir(cwd)
shutil.rmtree(framedir)
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):
if not os.path.exists(target):