mindspore.dataset.vision.read_video_timestamps
- mindspore.dataset.vision.read_video_timestamps(filename, pts_unit='pts')[source]
Read the timestamps and frames per second of a video file. It supports AVI, H264, H265, MOV, MP4, WMV files.
- Parameters
- Returns
list, when pts_unit is set to "pts", list[int] is returned, when pts_unit is set to "sec", list[float] is returned.
float, the frames per second of the video file.
- Raises
TypeError – If filename is not of type str.
TypeError – If pts_unit is not of type str.
RuntimeError – If filename does not exist, or not a regular file, or not a supported video file.
RuntimeError – If pts_unit is not in ["pts", "sec"].
- Supported Platforms:
CPU
Examples
>>> import mindspore.dataset.vision as vision >>> video_timestamps, video_fps = vision.read_video_timestamps("/path/to/file")