The idea is: rotate, crop, rotate back:
#!/usr/bin/python3 import cv2 import imutils cv2.namedWindow("preview"). vc = cv2.VideoCapture('test.mp4') if vc.isOpened(): # try to get the first frame rval, frame = vc.read() else: rval = False while rval: cv2.imshow("preview", frame) rval, frame = vc.read() if rval: frame = imutils.rotate_bound(frame, 45) h = frame.shape[0] w = frame.shape[1] frame = frame[h//2:h, 0:w] frame = imutils.rotate_bound(frame, -45) key = cv2.waitKey(20) if key == 27: # exit on ESC break vc.release() cv2.destroyWindow("preview")