I am trying to determine the orientation of the iPhone video file (.mov) when uploading via PHP form so that I can use FFMPEG to fix it (many downloaded videos are shown on their side). It seems I can’t find a way to access the orientation of the downloaded file on the server. Any ideas?
Using mediainfo
$ mediainfo test.mp4 | grep Rotation Rotation : 90°
You can use exec () to capture the output of this system call and apply the orientation fix (90 degrees clockwise):
$ ffmpeg -i test.mp4 -vf "transpose=1" testRotated.mp4
If you have --enable_vfilters
$ ffmpeg -vfilters "rotate=90" -i test.mp4 testRotated.mp4
I'm not the best with regex, but here's how I will do it
exec(ffmpeg -i uploaded.mov,$output)
, , pregmatch , :
preg_match('/(\d+)x(\d+)/', $output, $dims);
, $dims [1] $dims [2], , .
, - .
Source: https://habr.com/ru/post/1532107/More articles:i token of an input / output device for development and production - iosIntelliJ shortcut set not working - intellij-ideaЯвляется открытым исходным кодом Intel XDK? - html5ffmpeg fix video orientation - phpSectionGroupName is invalid - c #Get Web Service Content - iphoneDate format and datapicker - angular-ui-bootstrapHow to vertically align the contents of a media body in Twitter Bootstrap? - htmlBackbone return promise - javascriptHow to compile a module with a new kernel in Linux - cAll Articles