You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[torchcodec] Return subsequent frame if FFMPEG seeks past end of the frame (#178)
Summary:
Pull Request resolved: #178
The way get_frame_displayed_at works is as follows:
We call avformat_seek_file with:
`min_ts=-inf ts=timestamp max_ts=timestamp`
https://ffmpeg.org/doxygen/7.0/group__lavf__decoding.html#ga3b40fc8d2fda6992ae6ea2567d71ba30
This should in theory never seek past our timestamp.
However for some videos ffmpeg does seek past our timestamp.
And that causes us to never return a valid frame in that case.
The fix is to warn the user and return the first frame after the timestamp if this ever happens.
Differential Revision: D61139386
0 commit comments