Commit be74aed4 authored by Michael Murtaugh's avatar Michael Murtaugh
Browse files

Video thumb deal with failure

parent f9ce2683
......@@ -235,6 +235,8 @@ FFMPEGMeta = Builder(action=ffmpeg_get_meta)
def make_video_poster (target, source, env):
os.makedirs(os.path.dirname(target[0].path), exist_ok=True)
ret = subprocess.run(["ffmpeg", "-i", source[0].path, "-ss", "3", "-vframes", "1", target[0].path])
if ret.returncode != 0:
subprocess.run(["convert", "wizard:", "-auto-orient", "-resize", "320x320", "-flatten", target[0].path])
VideoPoster = Builder(action=make_video_poster)
# VideoThumb = Builder(action="""
......@@ -247,6 +249,9 @@ def make_video_thumb (target, source, env):
ret = subprocess.run(["ffmpeg", "-i", source[0].path, "-ss", "3", "-vframes", "1", target[0].path])
if ret.returncode == 0:
subprocess.run(["mogrify", "-resize", "200x200", target[0].path])
else:
subprocess.run(["convert", "wizard:", "-auto-orient", "-resize", "200x200", "-flatten", target[0].path])
VideoThumb = Builder(action=make_video_thumb)
# ImagePoster = Builder(action="""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment