I have a mp4 video that was originally shot with an iPhone. The user rotated the phone while recording the video, so 1/4 is in portrait mode and 3/4 is in landscape mode.
Is there a way using Python and OpenCV to correct the rotation of the video so the entire video is in one mode - either portrait or landscape?
I could use a “standard” video editor like Openshot to cut the video into 3 pieces, (1) the portrait mode part, (2) the intermediate rotation frames, and (3) the landscape part, discard the second part, rotate the third part, and then join the rotated third part with the first part. But the result is terrible due to the missing frames.
is there a better way to do it frame by frame in Python using OpenCV?