# import the opencv library
import cv2
import argparse

parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('-dev',  type=int,
                    help='video mode')

args = parser.parse_args()
args = vars(args)

print(args)
# define a video capture object
vid = cv2.VideoCapture(args['dev'])

while (True):

    # Capture the video frame
    # by frame
    ret, frame = vid.read()
    # print(frame.shape)

    # Display the resulting frame
    cv2.imshow('frame', frame)

    # the 'q' button is set as the
    # quitting button you may use any
    # desired button of your choice
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# After the loop release the cap object
vid.release()
# Destroy all the windows
cv2.destroyAllWindows()