?
Solved

Webcam Livestreaming On MFC

Posted on 2004-04-17
9
Medium Priority
?
12,056 Views
Last Modified: 2013-11-20
Has anyone done a program that obtain images from webcam ?
Or does anyone know how to do it ? i need to write a c++ application that can connect to a webcam and then show the images from the webcam on the viewing area of the program. anyone who has information or can direct me to the place with the appropriate solution for my problem...
0
Comment
Question by:itsharis999
  • 4
  • 4
9 Comments
 
LVL 4

Expert Comment

by:bkfirebird
ID: 10851543
you should use directx to capture video .... its pretty easy to use .... and there is a very good directshow example with source code which does that
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 250 total points
ID: 10851957
This is surprisingly easy:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_using_video_capture.asp

Go step-by-step and you can can get results in a few minutes.
You can use also CapTest MSDN sample. It contains a lot of code, but 90% of it is building of user-interface using API. Webcam-related stuff is simple.
0
 

Author Comment

by:itsharis999
ID: 10852886
Thanks for your comment Alex, but can u tell me one more thing, that from where i can download this CapTest MSDN Sample. and how can i integrate that in my own program... kindly help me... its urgent..
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 48

Expert Comment

by:AlexFM
ID: 10852906
Just type CapTest in the MSDN Library index. MSDN article "CapTest: AVICap Capture Window Class" contains download link.

0
 
LVL 48

Expert Comment

by:AlexFM
ID: 10852907
I don't think you can integrate this sample into your own program. It contains a lot of code, most of it is not related to video capturing. But you can use it as reference.
Using link from my first post you can do this without problems.
0
 

Author Comment

by:itsharis999
ID: 10852931
Thanks for your comment Alex, but can u tell me one more thing, that from where i can download this CapTest MSDN Sample. and how can i integrate that in my own program... kindly help me... its urgent...
0
 

Author Comment

by:itsharis999
ID: 10852970
The link you specified in your first ever comment have got some steps for capturing video. if i put the same code in the MFC class then will it work for me or i have to do something else, as there is no proper way written that how to use those samples in my own application... waiting for ur response...

.har!s.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 10853008
Suppose you have MFC dialog-based application. Add member:

HWND m_hCaptureWnd;

to the dialog class.

To connect to first available capture driver write:

    CAPSTATUS CapStatus;
    capDriverConnect(m_hCaptureWnd, 0);

Creating of capture window:

    m_hCaptureWnd = capCreateCaptureWindow(
        _T(""),
        WS_CHILD,
        0,
        0,
        CapStatus.uiImageWidth,
        CapStatus.uiImageHeight,
        m_hWnd,
        ID_CAPTURE_WND);

To set preview rate and start preview write:

    capPreviewRate(m_hCaptureWnd, 100);
    capPreview(m_hCaptureWnd, TRUE);'
0
 

Author Comment

by:itsharis999
ID: 10853141
Nothing is working for me, it is still giving too many errors too handle... im really new in MFC Windows Programming and it is scaring me alot... Can you email me any specific program's source-code or any of your self-made program that do just this function, like showing the stream from cam on the MFC interface...? or just provide me the link to it...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question