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
感谢中号大炮!我们最终通过在我们的服务器上手动编译FFMPEG并启用vfilter选项来解决此问题。 RedHat当前版本的FFMPEG很旧,没有vfilter选项。您的答案可能很好,可以将流程卸载到手机端,并确保视频保持在我们尚未考虑的正确方向。我很感激! – Shane 2012-03-05 20:06:28