Getting timestamp of each frame in a video

You want cv2.CAP_PROP_POS_MSEC. See all the different capture properties here. Edit: Actually, as Dan MaĊĦek pointed out to me, when you grab that property, it looks like OpenCV is exactly doing that calculation (at least assuming you’re using FFMPEG): case CV_FFMPEG_CAP_PROP_POS_MSEC: return 1000.0*(double)frame_number/get_fps(); So it seems you’re always going to rely on a constant frame … Read more