I just changed this part :
out = cv2.VideoWriter("output.avi", fourcc, 8.0, (500, 150))
but the problem is somehow remained. Still it is inconsistent. Like three times out of five times it saves the .avi file as 6kb again, specially if I change the saving path it is going to record as 6kb constantly. It is really strange.
changing
fourcc = cv2.VideoWriter_fourcc(*"XVID") to :
fourcc = cv2.VideoWriter_fourcc('M','J','P','G')
also solved the problem with inconsistency.
out = cv2.VideoWriter("output.avi", fourcc, 8.0, (500, 150))
but the problem is somehow remained. Still it is inconsistent. Like three times out of five times it saves the .avi file as 6kb again, specially if I change the saving path it is going to record as 6kb constantly. It is really strange.
changing
fourcc = cv2.VideoWriter_fourcc(*"XVID") to :
fourcc = cv2.VideoWriter_fourcc('M','J','P','G')
also solved the problem with inconsistency.