Computer Vision - VideoCapture()
Introduction and Use This is a function used to start capturing the video or starting the reading process or Simply opening the camera or start playing the video with imshow() for accurate : This is used to load the video in Memory so we can read and show the video frame by frame which is an another task code: import cv2 as cv cap = cv. VideoCapture ( 0 ) fourcc = cv. VideoWriter_fourcc ( * ' XVID ') output = cv. VideoWriter (" ./output/myvideo.avi ", fourcc , 20.0 ,( 640 , 480 )) while cap. isOpened (): ret, frame = cap. read () if not ret: break frame = cv. flip ( frame , 0 ) cv. imshow (" Video Capturing ", frame ) output. write ( frame ) if cv. waitKey ( 20 ) & 0x FF == ord (' x '): print (' Video saved Successfully in current Directory ') break #Now most important part releasing all the resourses to prevent the conflict between the resourses output. release () ca