After surfing through tons of documentation on the web it seems that the iPhone always shoots the video at a 480×360 aspect ratio and applies a transformation matrix on the video track. (480×360 may change but its always the same for a given device)
Here is a way of modifying the ffmpeg source within a iOS project and accessing the matrix http://www.seqoy.com/correct-orientation-for-iphone-recorded-movies-with-ffmpeg/
Here is a cleaner way of finding the transformation matrix in iOS-4
How to detect (iPhone SDK) if a video file was recorded in portrait orientation, or landscape.
How can the orientation of the video be extracted in either of the options below –
– iOS 3.2
– ffmpeg (through the command line server side)
– ruby
Any help will be appreciated.
Since most Cameras store their rotation/orientation within the exif-metadata, i would suggest using
exifttooland the a ruby wrapper gem calledmini_exiftoolwhich is actively maintained.Install exiftool:
apt-get exiftool || brew install exiftool || port install exiftoolor use what ever package manager is available
Install mini_exiftool:
gem install mini_exiftoolTry it:
cheers