🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

AVi playback tutorial - Alpha channel

Started by
3 comments, last by DoomhammerDE 17 years, 5 months ago
Hello and thank NeHe for your tutorials ! great work! I am working on a mixed reality project and therefore I need captured camera video with computer generated objects. I have to extend my renderer to display .avi files in opengl and your tutorial is the right way. My problem is it does not show how an avi file with integrated alpha channel can used. Is ist possible to use such an avi file as a RGBA texture ? How must the example adjusted to support this feature ? Thank you for all replies ! Chris
Advertisement
I'm not certain but I don't think any common video formats support an alpha channel. You could possibly use another avi in order to add an extra channel or mask. Can you describe your problem in more detail?

Cheers,
- llvllatrix
hi llvllatrix, thank you for your reply.

well, the most common video format , which supports an alpha channel in addition to rgb, is uncrompressed avi. (at least after effects can export and other video programs e.g. flash can import it and use the alpha channel)
I am not sure if the Video For Windows library used in the tutorial support this feature.

My problem in detail is: I do not know if its possible to extend the tutorial to support avi with integrated alpha channel and how this can be achieved :)
I have not found anything in the msdn related to the library and alpha channel in avi format.

Maybe it is a better solution to use a image sequence and load the next image into the graphic cards texture ram? there should be any problem with rgba textures in opengl?!


If there are any further questions , just ask :)

Thank you

Chris
Quote: Original post by DoomhammerDE
hi llvllatrix, thank you for your reply.

well, the most common video format , which supports an alpha channel in addition to rgb, is uncrompressed avi. (at least after effects can export and other video programs e.g. flash can import it and use the alpha channel)


Very cool :)

Quote:
I am not sure if the Video For Windows library used in the tutorial support this feature.


I suspect that the library used in the tutorial is old, and probably wont support this feature. It's probably time to start looking for a new library. I did a quick search on google and found these discussions. While they may not describe how to do it, these forums seem like a pretty good place to start asking questions:

http://dev.jahshaka.org/forum/archive/index.php/t-222.html
http://forum.doom9.org/archive/index.php/t-59845.html

Provided you can decode the avi with the alpha channel, OpenGL should be able to render it.

Quote:
My problem in detail is: I do not know if its possible to extend the tutorial to support avi with integrated alpha channel and how this can be achieved :) I have not found anything in the msdn related to the library and alpha channel in avi format.


I just want to make sure that you really need a solution that is this complicated. If all you need is an avi that is evenly transparent, you could use a normal avi and draw it on a polygon with reduced alpha. The only reason you should need something like this is if the transparency changes with the rest of the animation.

Quote:
Maybe it is a better solution to use a image sequence and load the next image into the graphic cards texture ram? there should be any problem with rgba textures in opengl?!


This should work as well. OpenGL does support rgba textures (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=33). The problem with this sort of approach is creating the video. My impression is that it is hard to make a set of tga files from an avi file; correct me if I'm wrong.

Cheers,
- llvllatrix
Quote:
I suspect that the library used in the tutorial is old, and probably wont support this feature. It's probably time to start looking for a new library. I did a quick search on google and found these discussions. While they may not describe how to do it, these forums seem like a pretty good place to start asking questions:

http://dev.jahshaka.org/forum/archive/index.php/t-222.html
http://forum.doom9.org/archive/index.php/t-59845.html

Provided you can decode the avi with the alpha channel, OpenGL should be able to render it.

thank you for this links... maybe I tried too much to find a solution with the given library that I've forgotten to look for another :)

Quote:
I just want to make sure that you really need a solution that is this complicated. If all you need is an avi that is evenly transparent, you could use a normal avi and draw it on a polygon with reduced alpha. The only reason you should need something like this is if the transparency changes with the rest of the animation.

Yes hat is the problem. I use video files captured in a blue box studio, which is keyed in after effects. Therefore it is essential that the alpha channel is used in the avi file.

Quote:
OpenGL does support rgba textures (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=33). The problem with this sort of approach is creating the video. My impression is that it is hard to make a set of tga files from an avi file; correct me if I'm wrong.

Oh thats easy as 123. Take your favourite video tool and export/render it to an image sequence :)


I will read the articles you found and try to make the best :)
Thank you for all your replies and your help.

Bye
Chris

This topic is closed to new replies.

Advertisement