No one takes the time to turn their phone 90 degrees before taking a video anymore. When they try to upload the portrait video to 7.2.x it fails every time.
Tested with portrait videos shot and uploaded directly from: iPhone 6S, Galaxy Note5, and Galaxy S6; with stock and custom ffmpeg.
Quick fix to add portrait - 9:16 aspect ratio support.
1. Add Video Size Option 360x640
Edit: /flash/modules/video/inc/constants.inc.php
find: (around line 16)
if(!defined("VIDEO_SIZE_16_9")) define("VIDEO_SIZE_16_9", "640x360");
Just below add:
if(!defined("VIDEO_SIZE_9_16")) define("VIDEO_SIZE_9_16", "360x640");
2. Video Aspect Ratio Detection
Edit: /flash/modules/video/inc/functions.inc.php
Find: (around line 194)
if(convertVideoFile($sFile, $sTmpl)) {
$aSize = getimagesize($sFile);
@unlink($sFile);
$iRelation = $aSize[0]/$aSize[1];
$i169Dif = abs($iRelation - 16/9);
$i43Dif = abs($iRelation - 4/3);
if($i169Dif > $i43Dif) return VIDEO_SIZE_4_3;
else return VIDEO_SIZE_16_9;
Change it to:
if(convertVideoFile($sFile, $sTmpl)) {
$aSize = getimagesize($sFile);
@unlink($sFile);
$iRelation = $aSize[0]/$aSize[1];
$i169Dif = abs($iRelation - 16/9);
$i916Dif = abs($iRelation - 9/16);
$i43Dif = abs($iRelation - 4/3);
if($i43Dif > $i916Dif) return VIDEO_SIZE_9_16;
else if($i169Dif > $i43Dif) return VIDEO_SIZE_4_3;
else return VIDEO_SIZE_16_9;
3. Add Portrait Thumbnail Support For Videos
Find: (around line 318)
if (isset($a['square']) && $a['square'] && isset($a['w']) && $a['w'])
$sResize = "-vf crop=out_w=in_h -s {$a['w']}x{$a['w']}";
Just below add:
if (isset($a['h']) > $a['w'] && isset($a['w']) && $a['w'])
$sResize = "-vf crop=out_h=in_w -s {$a['w']}x{$a['w']}";