pytorch / torchcodec

PyTorch video decoding
BSD 3-Clause "New" or "Revised" License
77 stars 9 forks source link

Fix pts -> index conversion in `get_frame_at_timestamps[_in_range]` #287

Closed NicolasHug closed 2 weeks ago

NicolasHug commented 2 weeks ago

This is a fix for the bug described in https://github.com/pytorch/torchcodec/pull/286. We use a sightly different solution as suggested in https://github.com/pytorch/torchcodec/pull/286#issuecomment-2435362727.

This PR fixes the behavior of both get_frame_at_timestamps() and get_frames_at_timestamps_in_range().

NicolasHug commented 2 weeks ago

Thanks for the review Ahmad. @scotts , I'll merge this now so I can move https://github.com/pytorch/torchcodec/pull/284 forward, but I'll happily address any further comment you may have

scotts commented 2 weeks ago

Just commenting to chime in on the actual merged PR that is is a great catch. Thanks for fixing my bug. :)