From 164a71ed51f1d4486652508646815accff4ee675 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 23 Aug 2016 18:11:20 +0200 Subject: [PATCH] decode stdout --- ox/file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ox/file.py b/ox/file.py index 1d92024..5d6368a 100644 --- a/ox/file.py +++ b/ox/file.py @@ -168,11 +168,11 @@ def avinfo(filename, cached=True): p = subprocess.Popen([ffmpeg2theora, '--info', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, error = p.communicate() + stdout = stdout.decode('utf-8') try: info = json.loads(stdout) except: # remove metadata, can be broken - stdout = stdout.decode('utf-8') reg = re.compile('"metadata": {.*?},', re.DOTALL) stdout = re.sub(reg, '', stdout) info = json.loads(stdout) @@ -214,6 +214,7 @@ def ffprobe(filename): ], stdout=subprocess.PIPE, stderr=subprocess.PIPE) info, error = p.communicate() + info = info.decode('utf-8') ffinfo = json.loads(info) def fix_value(key, value):