views:

340

answers:

3

Right now, what I'm trying to do is to make a new GUI, essentially a software using directX (more exact, direct3D), that display streaming images from Axis IP cameras.

For the time being I figured that the flow for the entire program would be like this: 1. Get the Axis program to get streaming images 2. Pass the images to the Direct3D program. 3. Display the program, on the screen.

Currently I have made a somewhat basic Direct3D app that loads and display video frames from avi videos(for testing). I dunno how to load images directly from videos using DirectX, so I used OpenCV to save frames from the video and have DX upload them up. Very slow.

Right now I have some unclear things: 1. How to Get an Axis program that works in C++ (gonna look up examples later, prolly no big deal) 2. How to upload images directly from the Axis IP camera program.

So guys, do you have any recommendations or suggestions on how to make my program work more efficiently? Anything just let me know.

A: 

Well you may find it faster to use directshow and add a custom renderer at the far end that, directly, copies the decompressed video data directly to a Direct3D texture.

Its well worth double buffering that texture. ie have texture 0 displaying and texture 1 being uploaded too and then swap the 2 over when a new frame is available (ie display texture 1 while uploading to texture 0).

This way you can de-couple the video frame rate from the rendering frame rate which makes dropped frames a little easier to handle.

Goz
Good idea. I'm considering using DirectShow too, but I prefer using Just direct3D and the Axis program. I'm gonna learn DirectShow also just in case.
Sodrohu
A: 

I use in-place update of Direct3D textures (using IDirect3DTexture9::LockRect) and it works very fast. What part of your program works slow?

Kirill V. Lyadvinsky
I'm not sure, but I'm guessing it's the part where the OpenCV saves the frame into an image, and the D3D later uploads and renders the image. Still, it's slow probably cause I am using software rendering, not hardware, cuz I don't have any graphics card.
Sodrohu
A: 

For capture images from Axis cams you may use iPSi c++ library: http://sourceforge.net/projects/ipsi/

It can be used for capturing images and control camera zoom and rotation (if available).

toshnya
Actually I prefer to use the SDK provided by Axis to extract the images. I've read some of the documentations and run thru the samples in VC++, as with a bit more work should be able to make it run. I also got an MFC program from a colleague that displays Axis cameras on a dialogue window. Gonna need to convert it to be compatible with my program tho.But thanks anyway. In case things don't go my way there's always your backup.
Sodrohu