Sign in to follow this  

Fastest way to display uncompressed video data

This topic is 4591 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

Hi, I have got video frames streamed in from a frame grabber. My app does some realtime image processing and displays either the original image or the processed result. Often it is necessary to paint some overlays above the images. As displying the original or processed image data has been optional and only for debug reasons until now pure GDI is used with backbuffering (SetDiBitsToDevice). My question is: How do I get the best performing display of live video data? There are no DirectShow drivers for the frame grabber. It should run windowed and it would be nice if drawing some overlayed lines and such things with GDI were possible to be compatible with existing code. As far as I understand DirectX it does no format conversion when blitting so I have to check what pixel format I have in windowed mode and manually convert my video data. Using shaders to do the format conversion is not an option. So I end up writing a conversion routine for every possible display mode right? This question is not really game related but I think there might be some guys here able to give some helpful advice. Thanks Markus

Share this post


Link to post
Share on other sites
Quote:
Original post by muhkuh
As far as I understand DirectX it does no format conversion when blitting so I have to check what pixel format I have in windowed mode and manually convert my video data.

Direct3D will, in some cases, do format conversion iirc - but you don't really want to use those routes as it wouldn't be any quicker than what you have now.

Instead, if you were to create a windowed-mode D3D device, create a suitably sized IDirect3DTexture9 object, acquired it's level-0 IDirect3DSurface9 interface and copied directly to that (ideally as a single block copy). You can then render the texture using TLQuads... Provided you're not using a particularly obscure format, the rendering (from a texture) to the screen should do any conversion (e.g. from ARGB32 to RGB16) for you.

It is important to note that copying/writing to/from video memory (where a D3D texture would be stored) can be quite slow due to traversing the AGP bus (Obviously, less of a problem with PCI-E cards).

I say this as a functionally equivelent D3D program has no guarantee of providing an automagical speed increase. You might be lucky, but in my experience, you'll probably have to (albeit not much) change the way that you deal with/represent the data in your program).

hth
Jack

Share this post


Link to post
Share on other sites
Seems like DirectX cannot do a lot for me. I looked for a way to hand my RGB24 bitmap to the graphics card and let it do the display for me. As there is no support for any 3byte texture (Voodoo3 Cards once had it?) this won't work. So the best thing I can do is to convert manually to RGBA and let the graphics chip do the format conversion to the actual display mode (RGB15, RGB16, RGB32, whatever). :-(

Share this post


Link to post
Share on other sites

This topic is 4591 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this