How to get timestamp using nvarguscamerasrc

• Hardware Platform (Jetson / GPU) AGX Xavier
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only) 4.4

I am getting a frame thru opencv cap.VideoCapture

cap = cv2.VideoCapture(“nvarguscamerasrc sensor-id=”+str(videoid)+" ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)NV12, framerate=(fraction)30/1 ! nvvidconv ! video/x-raw, format=(string)BGRx ! videoconvert ! queue ! appsink ")

In this case, is there a way to get timestamp from nvarguscamerasrc for the frame just read out by cap.read?

ret, frame = cap.read()

Please advise. Thanks a lot for your help.

I think just using:

timestamp = cap.get(cv2.CAP_PROP_POS_MSEC)

to get timestamp from nvarguscamerasrc, is this correct?

Hi,
Please go to OpenCV forum to get help. The source code of implementation is:
opencv/cap_gstreamer.cpp at master · opencv/opencv · GitHub

Timestamps are stored in DTS/PTS and looks like there is no code of fetching it from appsink. But we are not certain about this. Users in OpenCV forum have more experience and may give further suggestion.