Skip to content

Commit a24b575

Browse files
committed
The SIDE_DATA section inside a stream section are ignored
1 parent 7a97e3a commit a24b575

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

ffprobe/ffprobe.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def __init__(self, path_to_video):
3636
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
3737

3838
stream = False
39+
ignoreLine = False
3940
self.streams = []
4041
self.video = []
4142
self.audio = []
@@ -47,13 +48,20 @@ def __init__(self, path_to_video):
4748

4849
if '[STREAM]' in line:
4950
stream = True
51+
ignoreLine = False
5052
data_lines = []
5153
elif '[/STREAM]' in line and stream:
5254
stream = False
55+
ignoreLine = False
5356
# noinspection PyUnboundLocalVariable
5457
self.streams.append(FFStream(data_lines))
5558
elif stream:
56-
data_lines.append(line)
59+
if '[SIDE_DATA]' in line:
60+
ignoreLine = True
61+
elif '[/SIDE_DATA]' in line:
62+
ignoreLine = False
63+
elif ignoreLine == False:
64+
data_lines.append(line)
5765

5866
self.metadata = {}
5967
is_metadata = False

0 commit comments

Comments
 (0)