mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 08:50:41 +00:00
Text twiddles
This commit is contained in:
@@ -8,7 +8,8 @@ FFPROBE = 'ffprobe'
|
|||||||
|
|
||||||
|
|
||||||
def ffprobe(path):
|
def ffprobe(path):
|
||||||
arguments = [FFPROBE, "-of", "json", "-show_format", "-show_streams", path]
|
arguments = [FFPROBE, "-of", "json",
|
||||||
|
"-show_format", "-show_streams", path]
|
||||||
if int(sys.version[0]) < 3:
|
if int(sys.version[0]) < 3:
|
||||||
process = subprocess.Popen(arguments, stdout=PIPE)
|
process = subprocess.Popen(arguments, stdout=PIPE)
|
||||||
process.wait()
|
process.wait()
|
||||||
@@ -20,7 +21,8 @@ def ffprobe(path):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
process = subprocess.run(arguments, stdin=None, stdout=PIPE, stderr=PIPE)
|
process = subprocess.run(arguments, stdin=None,
|
||||||
|
stdout=PIPE, stderr=PIPE)
|
||||||
if process.returncode == 0:
|
if process.returncode == 0:
|
||||||
output_str = process.stdout.decode('utf-8')
|
output_str = process.stdout.decode('utf-8')
|
||||||
return json.loads(output_str)
|
return json.loads(output_str)
|
||||||
|
|||||||
Reference in New Issue
Block a user