Marian Bäuerle
Marian Bäuerle

Reputation: 371

MPMoviePlayerViewController plays recorded portrait movie rotated

I have a problem with the MPMoviePlayerViewController (I use the shortcut MPVC) playing recorded portrait movies right. (Tested on iPhone 4S with iOS 6.0.1) The app does this:

If I record a movie in portrait mode, the MPVC plays this video flipped to the right. Something similar happens if I record the movie in landscape mode right (home button on the left), then the movie is played upside down in MPVC. This only happens when playing the movie after uploading it! In the preview MPC, the movie just plays fine and not rotated!

I found some related SO questions involving rotated videos, but none are related explicitly to MPVC. I used this and found out that the orientation stored in the movie is perfectly correct. So portrait movies really return UIInterfaceOrientationPortrait with this Method.

So now my question is, is there a way to tell the MPVC to rotate the movie or treat it right? Or do I have to write my own player based on AVFoundation? Is this a MPVC bug, because the orientation information the movie provides seem to be correct?

Upvotes: 1

Views: 440

Answers (1)

Marcin
Marcin

Reputation: 64

I've recently stumbled upon similar issue where my videos were forced into landscape orientation after I uploaded them to 3rd party CDN. It turned out they were blindly "flipped" by 3rd party service to the landscape orientation and converted into iOS stream resource. There's probably nothing wrong with your videos, just make sure you understand what processes are in place after you've uploaded them because that might have been the case.

After having a long conversation with my CDN hosting provider, they confirmed an issue :

"The problem is that the trans-coding from the file in Cloud Files to an iOS stream seems to lose the EXIF information about orientation so it just displays as landscape."

The solution suggested was to rotate the video before uploading it.

Upvotes: 1

Related Questions