The format of the MP4 video file is analyzed using PHP to return rotation degree, width and height.
composer require cecil/php-read-mp4info
<?php
var_dump(\Mp4\Info::get('video.mp4'));
array(3) {
["rotate"] => int(0)
["width"] => int(960)
["height"] => int(544)
}