how to display YUV420P data in iPhone?

Discussion in 'iOS Programming' started by wwboy6, Oct 19, 2008.

  1. wwboy6 macrumors newbie

    Oct 19, 2008
    I have successfully import libavcodec library into a iphone application project, and I used it to decode a movie file into YUV420P data, so that I can get all the frames of the movie then convert them into RGB data, and so it can be displayed by OpenGL ES.

    The movie can be played successfully but it is quite slow as the conversion from YUV to RGB and the display method of OpenGL (glDrawArrays) is slow.

    Is there any smarter way to play the video (assuming the movie must be decoded by libavcodec)? Like display the YUV directly or convert to a YUV-like data which can be display directly? Or other display method faster than glDrawArrays? Can YUV data be loaded by Core Graphics?

    Thanks for any help.
  2. sio2interactive macrumors newbie

    Sep 16, 2008
    In my engine theora but the YUV to RGB conversion is the same, as well as the routine to convert it to texture... check it out
  3. johnpalaco macrumors newbie

    Feb 8, 2009
    gltrawtex oes

    Could you use glDrawTexOES instead of gldrawarrays? maybe that would speed things up?

Share This Page