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