In my program I am reading an original video, then cropping every frame and finally I need to make a video of all the cropped frames.
The frames are cropped with the size I define (top, bottom, left and right), but it doesn't save it to a video.
What I'm trying is the following:
input_video = cv2.VideoCapture(videosPath+"/"+video)
while True:
ret, frame = input_video.read()
if not ret:
break
for (top, right, bottom, left) in *****
crop_img = frame[top:bottom, left:right]
fourcc = cv2.VideoWriter_fourcc(*'XVID')
output_movie = cv2.VideoWriter('videoPrueba.avi', fourcc, 30, (450, 360))
output_movie.write(crop_img)
Thanks !