diff --git a/pims/pyav_reader.py b/pims/pyav_reader.py index 220c7a1..2b453ee 100644 --- a/pims/pyav_reader.py +++ b/pims/pyav_reader.py @@ -59,7 +59,7 @@ def _gen_frames(demuxer, time_base, frame_rate=1., first_pts=0): "Unable to read video: frames contain no timestamps. " "Please use PyAVReaderIndexed.") t = (timestamp - first_pts) * time_base - i = int(t * frame_rate) + i = int(round(t * frame_rate)) yield WrapPyAvFrame(frame, frame_no=i, metadata=dict(timestamp=timestamp, t=float(t)))