diff --git a/ffprobe/ffprobe.py b/ffprobe/ffprobe.py index f1eb3dc..e7a4639 100644 --- a/ffprobe/ffprobe.py +++ b/ffprobe/ffprobe.py @@ -8,6 +8,7 @@ import platform import re import subprocess +from pathlib import Path from ffprobe.exceptions import FFProbeError @@ -31,7 +32,10 @@ def __init__(self, path_to_video): if platform.system() == 'Windows': cmd = ["ffprobe", "-show_streams", self.path_to_video] else: - cmd = ["ffprobe -show_streams " + pipes.quote(self.path_to_video)] + if isinstance(self.path_to_video, Path): + cmd = ["ffprobe -show_streams " + self.path_to_video.as_posix()] + else: + cmd = ["ffprobe -show_streams " + pipes.quote(self.path_to_video)] p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)