Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7417911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:47:20+00:00 2026-05-29T07:47:20+00:00

I am using ffmpeg to play video on iOS 5.0. In my app with

  • 0

I am using ffmpeg to play video on iOS 5.0. In my app with ffmpeg decoded video frames and use OpenGL to display it.

But I have a problem I don’t resolve it. Chains logos and subtitles of the video image is displayed in reverse. I think that is the problem of rendering OpenGL 2.0 or ffmpeg decoded.

Can you tell me what is wrong?, and How I can fix it?

Very thanks,

Edit: I change my prepareTExture method with this:

- (void) prepareTextureW: (GLuint) texW textureHeight: (GLuint) texH frameWidth: (GLuint) frameW frameHeight: (GLuint) frameH {

float aspect = (float)frameW/(float)frameH;
float minX=-1.f, minY=-1.f, maxX=1.f, maxY=1.f;
float scale ;
if(aspect>=(float)backingHeight/(float)backingWidth){
    // Aspect ratio will retain width.
    scale = (float)backingHeight / (float) frameW;
    maxY = ((float)frameH * scale) / (float) backingWidth;
    minY = -maxY;
} else {
    // Retain height.
    scale = (float) backingWidth / (float) frameW;
    maxX = ((float) frameW * scale) / (float) backingHeight;
    minX = -maxX;
}
if(frameTexture) glDeleteTextures(1, &frameTexture);
glEnable(GL_TEXTURE_2D);
glGenTextures(1, &frameTexture);
glBindTexture(GL_TEXTURE_2D, frameTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, texW, texH, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, NULL);          


 verts[0] = maxX;           
  verts[1] = maxY;
  verts[2] = minX;      
  verts[3] = maxY;
  verts[4] = maxX;  
  verts[5] = minY;
  verts[6] = minX;    
  verts[7] = minY;

float s = (float) frameW / (float) texW;
float t = (float) frameH / (float) texH;             

texCoords[0] = 0.f;        texCoords[1] = 1.f;
texCoords[2] = 1;          texCoords[3] = 1.f;
texCoords[4] = 0.f;        texCoords[5] =0;
texCoords[6] = 1;          texCoords[7] =0;

mFrameH = frameH;
mFrameW = frameW;
mTexH = texH;
mTexW = texW;
maxS = s;
maxT = t;

// Just supporting one rotation direction, landscape left.  Rotate Z by 90 degrees.
matSetRotZ(&rot,M_PI_2);

matMul(&mvp, &rot, &rot);
[self setupShader];    

}

And now this is my result: link image

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:47:20+00:00Added an answer on May 29, 2026 at 7:47 am

    But I have a problem I don’t resolve it. Chains logos and subtitles of the video image is displayed in reverse.

    The whole image is mirrored, not just chain logo and subtitles. Looks like wrong texture coordinates to me. Could you please post your drawing code?

    EDIT due to question update

    Phew I first had to understand what you do there, it’s overly complicated. Just use texture coordinates 0 and 1, don’t try to outsmart yourself by calculating some s, t. Next step. Don’t use a perspective projection, unless you indend to render something in perspective.

    Upon your original problem. OpenGL assumes the origin of an image to be in the lower left, while most video formats put the origin into the upper left. What you did was rotating the picture, but while this will turn it upright, it will leave it mirrored. Instead you want to mirror it along the T texture coordinates, which is easily accomplished by using a negative value for t.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using FFmpeg to extract informations about a video file. But i want to
I'm using ffmpeg in Ubuntu for the image creation and video conversion my problem
I'm creating Video using FFMPEG from pngs. The problem is on creating the video,
I am using ffmpeg in linux server...the video conversion is working fine,but thumbnail creation
I can play video files with FFmpeg libary.( just implement tutorials about ffmpeg). But
I'm trying to get the RTSP video stream play in my Android App using
I need to extract stills from video files. Currently I am using ffmpeg, but
I use ffmpeg to convert video using H264 for video encoding, and FAAC for
I'using the following code to create thumbnails using ffmpeg but it was working fine
I created an .png image from a video using ffmpeg tool and i want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.