diff --git a/oxtimelines/timeline.py b/oxtimelines/timeline.py index 9624a06..8be0054 100644 --- a/oxtimelines/timeline.py +++ b/oxtimelines/timeline.py @@ -43,8 +43,11 @@ class Video(gst.Pipeline): self.sbin.props.expose_all_streams = True self.add(self.src, self.sbin) + info = ox.avinfo(uri) + self.audio = self.audio and info['audio'] != [] + self.video = self.video and info['video'] != [] + if self.video: - info = ox.avinfo(uri) ratio = info['video'][0]['width'] / info['video'][0]['height'] self.width = int(round(self.height * ratio)) if self.width % 4: