I’m using cv2.VideoCapture(rmtp_source) to get rmtp video stream and I need to extract the timestamp of each frame.
I google around and find some examples using functions:
getRTPTimeStampTs()
getRTPTimeStampSeconds()
getRTPTimeStampFraction()
which seems to fit my requirements.
However, I have tried OpenCV 4.5.1 / 3.4.1 but they all complains:
“AttributeError: ‘cv2.VideoCapture’ object has no attribute ‘getRTPTimeStampTs’”
Any suggestion where these function locate?
b.t.w. I noticed another option: timestamp = cap.get(cv2.CAP_PROP_POS_MSEC). But this value is relative to the start of video, in our rtmp streaming case, it is when I pull the stream not when the stream starts.