Ask Your Question

Revision history [back]

Incorrect Video Orientation

I have written some code that uses OpenCV to read frames from a video file and display them using OpenGL. This works fine except for videos taken with my smartphone where the video is rotated by 90 degrees. From my understanding, the orientation info is in the metadata section of the file, but OpenCV doesn't seem to use this information nor does it provide any means of getting that information.

How can I detect the video orientation so that I can correct it? Is my only option using an external tool like e.g. MediaInfo?