Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: how to play video in opengl?

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2005
    Location
    china
    Posts
    8

    how to play video in opengl?

    I have a project.
    It make me to player a media file such as ".rm" and ".mpeg" on a model, so how do that?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    The Round Table at Camelot
    Posts
    1,264

    Re: how to play video in opengl?

    There's a tutorial on using a video as a texture at NeHe's site. http://nehe.gamedev.net


    -SirKnight
    -SirKnight

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    The Round Table at Camelot
    Posts
    1,264

    Re: how to play video in opengl?

    Also, this may be of some use: http://download.developer.nvidia.com/dev...ideoeffects.zip


    -SirKnight
    -SirKnight

  4. #4
    Junior Member Newbie
    Join Date
    Jan 2006
    Location
    pakistan
    Posts
    2

    Re: how to play video in opengl?

    opengl is very slow why are u using it???

  5. #5
    Senior Member OpenGL Guru knackered's Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    2,833

    Re: how to play video in opengl?

    no, inaam is very slow, that's why I don't use him to play video.
    Knackered

  6. #6
    Junior Member Regular Contributor
    Join Date
    Jan 2004
    Location
    .dk
    Posts
    134

    Re: how to play video in opengl?

    Knackered - I use inaam for playing video. For the replays.

    I've created a wrapper for using video-for-windows, that is basically the nehe-tutorial with rectangle-textures, without the assembler-stuff (and with a bug fixed... and a couple added probably). It simplifies matters quite a bit I think.

    http://www.userwebs.dk/gjoel/glmovie.zip

    Cheers,

  7. #7
    Junior Member Regular Contributor
    Join Date
    Feb 2001
    Posts
    134

    Re: how to play video in opengl?

    Originally posted by inaam:
    opengl is very slow why are u using it???
    Little knowledge is dangerous. Lie down before you hurt yourself.

  8. #8
    Advanced Member Frequent Contributor yooyo's Avatar
    Join Date
    Apr 2003
    Location
    Belgrade, Serbia
    Posts
    872

    Re: how to play video in opengl?

    Do search in this forum's. There is a several topics about playing video using OpenGL.

    Easyest way is to modify Texture3D example from DXSDK that use Direct3D. Just remove D3D code and insert OpenGL calls.

    yooyo

  9. #9
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    5

    Re: how to play video in opengl?

    If you want it to be fast you might have to resort to using more than the bare minimum of OpenGL.

    First - do not use glDrawPixels(). There is nothing wrong per se with glDrawPixels(), but it has a high probability of being slower.

    Look at using YCbCr textures instead of RGB as this can save quite a bit of bandwidth. There are a few extensions which might do this or you could write a fragment shader - which is what I did. An YCbCr to RGB shader is very simple and is probably the best option for modern hardware.

    Look at the ARB_pixel_buffer_object extension and see if you can transfer the textures more efficiently.

    And on a non GL related note you should probably look into decoupling the display and decode functions by using double-buffering and decoding in a separate thread.

    I have found that with a little work, OpenGL is quite good at displaying video.

  10. #10
    Junior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Germany
    Posts
    205

    Re: how to play video in opengl?

    @tesla: could you provide your YCbCr to RGB shader to the forum?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •