Skip to content

Commit

Permalink
Merge pull request #552 from deuteronomy-works/development
Browse files Browse the repository at this point in the history
Resolves #549
  • Loading branch information
amoh-godwin authored Dec 4, 2022
2 parents fb99956 + 56c04e7 commit 5f5d837
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pyffmpeg/pseudo_ffprobe.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, file_name=None):
self.start = 0
self.bitrate = 0
self.type = ''
self.metadata = [[{}, {}], {}] # mock indeces
self.metadata = [[], {}] # mock indeces
self.other_metadata = {}
self._other_metadata = []

Expand Down Expand Up @@ -74,7 +74,7 @@ def _expose(self):
if 'fps' in self.metadata[0][0]:
self.fps = self.metadata[0][0]['fps']

elif 'fps' in self.metadata[0][1]:
elif len(self.metadata[0]) > 1 and 'fps' in self.metadata[0][1]:
self.fps = self.metadata[0][1]['fps']

def _extract(self):
Expand Down Expand Up @@ -102,12 +102,13 @@ def _extract_all(self, stdout):
# individual streams
streams = all_streams.split('Stream')
for x in range(len(streams)):

if x == 0:
if streams[x]:
self.metadata[-1] = self._parse_input_meta(streams[x])
else:
if streams[x]:
self.metadata[0][x-1] = self._parse_meta(streams[x])
self.metadata[0].append(self._parse_meta(streams[x]))

# parse other metadata
self._parse_other_meta()
Expand Down

0 comments on commit 5f5d837

Please sign in to comment.