How to handle video orientation from mobile devices

I have a server component that handles video downloads for a web / iOS / Android application.

However, I ran into the problem of processing video orientation. Is there a good way to solve this problem? I have a MediaInfo tool that pulls metadata from a device, but this is what I encounter

Ios

  • portrait correct 90 or 270
  • the landscape is crazy. if you hold the device with the button to the left, it reports 0 for the front camera and 180 for the rear panel.

Android

  • here the situation is reversed, the terrain is correct in both the front and rear cameras
  • portrait - 90 or 270, depending on whether you use the front or rear camera.
  • In addition, some devices, such as Motorola Droids and Evo4G, do not record metadata at all.

Has anyone seen a clean solution for this?

+4
source share
1 answer

There are no clean solutions for Android devices that do not report orientation.

For all other orientations, I too complicated this in my mind. A flip between the front and rear means that the corners are correct if they are rotated clockwise.

0
source

Source: https://habr.com/ru/post/1432285/


All Articles