From 91a1bc91a731bcb9729d58c9ffc35a70108e72de Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Wed, 28 Jul 2021 10:54:05 +0300 Subject: [PATCH] [~] Refactor --- python/tasks/mlb_player.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/python/tasks/mlb_player.py b/python/tasks/mlb_player.py index 2d70bf2..3f2640c 100644 --- a/python/tasks/mlb_player.py +++ b/python/tasks/mlb_player.py @@ -1683,13 +1683,16 @@ def kernel_27(): t2 = os.path.join(t3, 'slice-%d' % i) os.makedirs(t2, exist_ok=True) t4 = os.path.join(t2, 'output.mp4') - with subprocess.Popen(''' - ffmpeg \ - -i %s \ - -ss %d \ - -t %d \ - %s - ''' % (t5, t1[0], t1[1] - t1[0], t4), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p: + with subprocess.Popen([ + 'ffmpeg', + '-i', + '%s' % t5, + '-ss', + '%d' % t1[0], + '-t', + '%d' % t1[1] - t1[0], + '%s' % t4, + ], stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p: pprint.pprint(p.communicate()) p.wait() assert p.returncode == 0