Python Program to capture Web Cam Video using OpenCV (cv2)

Python Source Code :

# Python Program to Capture Video on Desktop
# import opencv (cv2) library 
import cv2
# define a video capture object 
videobj = cv2.VideoCapture(0) 
while(True): # Frames are captured until you press 'q'
    # Capture the video frame by frame 
    ret, frame = 
    # Display the resulting frame on Desktop window 
    cv2.imshow('frame', frame) 
    # when the 'q' button is loop breaks  
    if cv2.waitKey(1) & 0xFF == ord('q'): 
# After the loop release the cap object 
# Destroy all the windows 

Output :

Information shared by : PALGUNI G T