Missing a float conversion.

This commit is contained in:
Frédéric Tronel
2023-12-02 20:57:59 +01:00
parent b4e304d9ab
commit da13f3e9c8

View File

@@ -256,12 +256,13 @@ def getFramesInStream(inputFile, begin, end, streamKind, subStreamId=0):
frames = frames['frames']
for frame in frames:
if 'pts_time' in frame:
pts_time = frame['pts_time']
pts_time = float(frame['pts_time'])
elif 'pkt_pts_time' in frame:
pts_time = frame['pkt_pts_time']
pts_time = float(frame['pkt_pts_time'])
else:
logger.error('Impossible to find timestamp of frame %s' % frame)
return None
ts = timedelta(seconds=pts_time)
if begin <= ts and ts <= end:
res.append(frame)