#This Python and OpenCV code shall add a line between start and end points #defined by the user. Not that audio shall not get copied. Also, the code #does not check availability of input files in the appropriate folder. #------ -------- ------ -------- ------ -------- ------ -------- ------ ------- import cv2 vin = 'v1.mp4' vex = 'v1_lined.mp4' cap = cv2.VideoCapture(vin) h = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) fps = cap.get(cv2.CAP_PROP_FPS) s = (5, h-5) e = (w-10, h) c = (255, 0, 0) #Adjust BGR values to get desired colour. size = (w, h) fourcc = cv2.VideoWriter_fourcc('m','p','4','v') videowriter = cv2.VideoWriter(vex,fourcc,fps,size) while (True): ret, f = cap.read() if ret == True: im=cv2.line(f, pt1=s,pt2=e,color=c, thickness=5,lineType=8,shift=0) videowriter.write(im) else: break cap.release() cv2.destroyAllWindows()