Skip to content

Commit

Permalink
Merge pull request #370 from Britefury/pyav-gen_frames-rounding
Browse files Browse the repository at this point in the history
Fix frame number generation in `pyav_reader._gen_frames`
  • Loading branch information
nkeim authored Mar 13, 2021
2 parents df3d7d8 + 615e833 commit 68c560e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pims/pyav_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down

0 comments on commit 68c560e

Please sign in to comment.