• Advertisement

Archived

This topic is now archived and is closed to further replies.

Using AVI-Videos with DX8 D3D-Textures

This topic is 5977 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m writing a little 3D-Engine and thought that it might be a nice feature to have video-textures. Now I looked at some really old DX6 SDK-Samples and found out how to read AVI-Videos into DX6 Texture Surfaces. I have tried several things to port this code to DX8, but I don''t have a clue how to access textures directly (e.g. by locking them). The AVI-reading-function returns a BITMAPINFO* pbmi; which contains information about size & other things of the decompressed frame followed by the picture. Now I wonder how to get this Bitmap into a Texture. Btw: If you have any suggestions on how to have a better video texture support, let me know Thanx in advance - Mithrandir

Share this post


Link to post
Share on other sites
Advertisement
Thanks for the hint, somehow I didn''t see it myself. But as the sample quits with an error like "can''t build filtergraph" or so I can''t just copy the code. Instead I mixed the old DX6 AVI-reading routine with the DX8 texture management routine. Now it works (partly) and needs only a bit of time to get it right. For example the video is played upside down and the 16bpp video doesn''t look nice in 32bpp, but I think I can manage that

Share this post


Link to post
Share on other sites
Well I did it, but one thing is disturbing me further. When I want to load an AVI with the DX6 method I can only load the video from disk. But as I am using a virtual filesystem like Quake3 with it''s pk3 aka. zip files, I can''t have the videos in there. Now I''d like to know if there is any other set of API-Functions that can decode AVI-Videos from memory except for DShow, which I don''t like much, because of it''s weird structure.

I am currently using the functions like AVIStreamOpenFromFile. Plz give me another API to use or show me how to make this API work with files in memory.

Share this post


Link to post
Share on other sites
You could do other things, but you would have to make sure you synched correctly, etc. You thing to consider:

DShow can basically be thought of as a set of filters that look like:

Reader->Processor->Renderer

where frames get passed around. It sounds like you''ve conquered the last two, now you just need to write a filter that reads the video from your format. Look at the samples again...

DirectShow can be strange, but this is a case where you probably don''t want to reinvent the wheel. You can get about 95% of the way using the AVI functions and some simple bitmap functions, but the last 5% is a nightmare.

Share this post


Link to post
Share on other sites

  • Advertisement