Below code me to extract individual frame from the video, I just wanted to make a new video file from frame 21 to 24. I wanted to save frames 21 to 24 in an array that I could later convert to a video file.
while success:
success, image = vidobj.read()
cv2.imwrite("frame%d.jpg"%count, image)