Can't save videos that are cropped

MRE is required. out is not defined. also watch that you have a waitKey() somewhere, or else the imshow window will remain numb.

OpenCV is for computer vision, not for video encoding. look at the imageio package or the PyAV package.

VideoWriter expects you to give it frames that are the exact same size you promised in the constructor.