Hi,
Please set sync=0 to appsink like:
import sys
import cv2
def read_cam():
cap = cv2.VideoCapture("filesrc location=test.mkv ! matroskademux ! h264parse ! nvv4l2decoder enable-max-performance=1 ! nvvidconv ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw,format=BGR ! appsink sync=0 ")
if cap.isOpened():
count = 0;
while True:
ret_val, img = cap.read();
if not ret_val:
break;
count = count + 1
if count % 150 == 0:
print("decoded frames:", count)
else:
print("rtsp open failed")
cap.release()
if __name__ == '__main__':
read_cam()
So that you can get decoded buffers immediately. If you need to have interval between the buffer, you can add delay while calling cap.read()