read_video_timestamps¶
- torchvision.io.read_video_timestamps(filename: str, pts_unit: str = 'pts') Tuple[List[int], Optional[float]] [source]¶
List the video frames timestamps.
Warning
In the near future, we intend to centralize PyTorch’s video decoding capabilities within the torchcodec project. We encourage you to try it out and share your feedback, as the torchvision video decoders will eventually be deprecated.
Note that the function decodes the whole video frame-by-frame.
- Parameters:
- Returns:
presentation timestamps for each one of the frames in the video. video_fps (float, optional): the frame rate for the video
- Return type:
pts (List[int] if pts_unit = ‘pts’, List[Fraction] if pts_unit = ‘sec’)