Click to See Complete Forum and Search --> : Spy Program


Chirieac
April 2nd, 2008, 12:31 PM
Hi! I've just finished learning C++ and I want to make something to impress my familly ("What the hell are you doing all day in front of that **** computer? Get a job!"). So I've decided to make a spy app to do this things:

1. Access the webcam and record to a file without the user to know (in background).
2. Acces the microphone and record to a file.

Maybe if I can do that I can impress them.
Please, help me! How this 2 task can be acomplished?

Please forgive me if this is not the right place to post this.

Bye!

STLDude
April 2nd, 2008, 01:22 PM
I'm glad I'm not your family.

Igor Vartanov
April 2nd, 2008, 05:04 PM
I've just finished learning C++Lucky you. I'm still learning it... :(

Krishnaa
April 3rd, 2008, 02:51 AM
Do you know anything about Win32/MFC programming ?

Chirieac
April 3rd, 2008, 05:11 AM
Yes, I know Win32/MFC programming.

Edders
April 3rd, 2008, 05:18 AM
I would recommend to start by making a simple program that just does the second bit - record from a microphone and store the audio in a file. When you've covered that successfully then make another application that just records the video to a file.
Then you can make a third program that includes the functionality of these previous two applications together with any other things you think you may need for your program.

There are several methods in capturing media on Windows, but you may want to look into the MCI interface on www.msdn.com.

Krishnaa
April 3rd, 2008, 06:58 AM
Yes, I know Win32/MFC programming.

Then it's time to learn how to program WebCam/DigiCams using WIA,

msdn2.microsoft.com/en-us/library/ms629863(VS.85).aspx

Chirieac
April 3rd, 2008, 07:25 AM
Thank for your replys.

But what about video for windows with the AVICap window class (http://msdn2.microsoft.com/en-us/library/ms713477(VS.85).aspx).

Or what about MCI interface that Edders talk.

I want to use something that all the webcams will work (if that is possible).

Chirieac
April 3rd, 2008, 07:35 AM
"The WIA API is designed for use by C/C++ programmers. Familiarity with the Windows graphical user interface (GUI) and Component Object Model (COM) interfaces is required."

Do you know some books or maybe some good tutorials to learn something about COM? Just to allow me to use WIA API.

MCI is using COM too?

Krishnaa
April 3rd, 2008, 08:10 AM
There are several ways like AVICap, it's upto you, I would say go through all possible techniques and see whats best for you.

I don't remember any book on topic but there are a lot of resource on internet.

Chirieac
April 3rd, 2008, 08:32 AM
Thanks Krishnaa for your quick reply!

But what is the best way?

Maybe, after I do this 2 tasks (to capture the webcam and microphone) I will start to learn something about the internet programming. So I can practice the internet programming by making somekind of conference app:
an app to be able to send text messages, see the web of my friend, listen to him.

So I don't want to get in trouble then that my app is not working with his webcam, microphone. That's why I ask which is the best way (of course every way with his pros and cons).

Krishnaa
April 3rd, 2008, 08:36 AM
The best would be the one which goes easy for you, I haven't done a lot of video programming so I can't suggest you the best of my knowledge, but I believe WIA would do a good job, I have seen a lot of programs developed using that.

Chirieac
April 3rd, 2008, 09:16 AM
Thanks Krishnaa, I will look at WIA.

I've found two methods to use the webcam:

1. Using WIA SDK
2. Using "avicap32.dll"

The second method is a bit harder then the first.

What I'm interesting is what will support more types of webcams (I'm afraid that maybe some older webcams will not work with WIA).

Chirieac
April 3rd, 2008, 09:53 AM
I've found this: "WIA supports <TakePicture> but that operation isn't fast enough to get more than a few frames a second." here: http://www.hanselman.com/blog/CapturingVideoAWebCameraUsingWIANotPossible.aspx

I don't mind if I save every frames separately like a jpeg.
What I want is to capture how many frames I can with speed (if I want to make later a conference internet app - so I need to capture and send the data fast, right?) and my app be compatible with every webcam (or almost).

Bye!

Chirieac
April 3rd, 2008, 07:21 PM
Thanks for your replys!

With this lines of code AVICap saves the data from a webcam tu a CAPTURE.AVI automaticly:

HWND hWndC = capCreateCaptureWindow (L"My Own Capture Window",
WS_CHILD | WS_VISIBLE , 0, 0, 640, 480, m_hCap, 0);

capDriverConnect (hWndC, 0);
capPreview(hWndC, true);

capCaptureSequence (hWndC);

So I think AVICap is the to go.

Bye!