From 95f423cca910a3ffc96b4aa12f8802130f545547 Mon Sep 17 00:00:00 2001 From: Amoh Gyebi Ampofo Date: Sun, 4 Dec 2022 05:42:18 +0000 Subject: [PATCH 1/2] Update pseudo_ffprobe.py --- pyffmpeg/pseudo_ffprobe.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyffmpeg/pseudo_ffprobe.py b/pyffmpeg/pseudo_ffprobe.py index f7b9154..032286e 100644 --- a/pyffmpeg/pseudo_ffprobe.py +++ b/pyffmpeg/pseudo_ffprobe.py @@ -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 = [] @@ -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() From 56c04e70cb74ca6da45ba925a44a5d569ed756f5 Mon Sep 17 00:00:00 2001 From: Amoh Gyebi Ampofo Date: Sun, 4 Dec 2022 05:42:32 +0000 Subject: [PATCH 2/2] Update pseudo_ffprobe.py --- pyffmpeg/pseudo_ffprobe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyffmpeg/pseudo_ffprobe.py b/pyffmpeg/pseudo_ffprobe.py index 032286e..56f1ec3 100644 --- a/pyffmpeg/pseudo_ffprobe.py +++ b/pyffmpeg/pseudo_ffprobe.py @@ -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):