Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1b3ac5 commit bfaec2aCopy full SHA for bfaec2a
ffprobe3/ffprobe.py
@@ -54,9 +54,25 @@ def __init__(self, path_to_video):
54
elif stream:
55
data_lines.append(line)
56
57
+ self.metadata = {}
58
+ is_metadata = False
59
+ stream_metadata_met = False
60
+
61
for line in iter(p.stderr.readline, b''):
62
line = line.decode('UTF-8')
63
64
+ if 'Metadata:' in line and not stream_metadata_met:
65
+ is_metadata = True
66
+ elif 'Stream #' in line:
67
68
+ stream_metadata_met = True
69
+ elif is_metadata:
70
+ splits = line.split(',')
71
+ for s in splits:
72
+ m = re.search(r'(\w+)\s*:\s*(.*)$', s)
73
+ # print(m.groups())
74
+ self.metadata[m.groups()[0]] = m.groups()[1].strip()
75
76
if '[STREAM]' in line:
77
stream = True
78
data_lines = []
0 commit comments