Reputation: 16827
We just recently created an iPhone app for one of our system that allows users to upload picture and video content to our services. The last major hitch we are running into is how to handle videos that are uploaded in an orientation other than Horizontal Right. Apparently if your playback system does not account for the orientation flag sent with the video then it will play upside down or sideways.
The correct approach appears to be that the playback system should take the orientation flag into account just prior to playback. This is the way Apple handles it directly on the device as well as through Quicktime.
SO my first hope is that someone is aware of a web based (HTML5 or Flash) player that is capable of rotating a video during playback based on either the video orientation metadata or based on a passed flag (we already have the necessary flag available in the DB if we need to just pass it manually). If you know of any such player then PLEASE SHARE!
If you aren't aware of such a player, then has anyone had any luck rotating their videos using FFMPEG or MEncoder? We did a few hours of testing last week and weren't able to get any decent results from the two heavy hitters mentioned there.
Failing ALL OF THAT, is it possible to have the iPhone upload a video or image in a specified direction?
Any of the three will work for me, but I would prefer to do whatever is standard (if one exists).
Any help is much appreciated!
Upvotes: 0
Views: 477
Reputation: 11
Maybe I am missing what you asking but if you are using ffmpeg on the iPhone or android which uses opengl couldn't you read the metadata in the stream and adjust the orientation accordingly with glrotate, we had a similar issue on the ipad/iphone when someone changes the orientation. We watch for the orientation change notification and rotate the display.
#ifdef LANDSCAPE
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
#ifdef __IPAD__
printf("got to ipad");
glViewport(0, 0, 768, 1024);
if (isFlipped())
glRotatef(90, 0, 0, 1);
else
glRotatef(-90, 0, 0, 1);
glOrthof(0.0, (GLfloat) 1024, (GLfloat) 768, 0.0, 0, 100.0f);
#else
glViewport(0, 0, 320, 480);
if (isFlipped())
glRotatef(90, 0, 0, 1);
else
glRotatef(-90, 0, 0, 1);
glOrthof(0.0, (GLfloat) 480, (GLfloat) 320, 0.0, 0, 100.0f);
#endif
#else
data->glMatrixMode(GL_PROJECTION);
data->glLoadIdentity();
data->glMatrixMode(GL_MODELVIEW);
data->glLoadIdentity();
data->glViewport(0, 0, window->w, window->h);
data->glOrthof(0.0, (GLfloat) window->w, (GLfloat) window->h, 0.0,
0, 1.0);
#endif
data->updateSize = SDL_FALSE;
}
You can also check out or iOS video player project for ways to extract metadata from the video stream.
www.mooncatventures.org/mediawiki
Upvotes: 1