I am using moviepy to automatically create a movie from lots of videos. Some of these videos will be portrait, and some landscape. I need to be able to grab the orientation of each video from its metadata, and then rotate it in moviepy if it returns 'portrait'.
I have found this code, which extracts metadata using ffprobe, and outputs height and width, but I don't know how to get the orientation.
Several people have mentioned mediainfo, but I don't know how to extract the information from the terminal result.
There are two PyPI module, ffprobe and mediainfo, which are both python wrappers for their respective tools, but the usage information is practically nonexistent.
I have found several questions, but they do not answer my question in enough detail:
how to get a video file's orientation in Python
I know SO isn't "writemycode.com" but this isn't documented anywhere, and I have looked thoroughly.