Solved

Webcam Livestreaming On MFC

Posted on 2004-04-17
9
11,993 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 125 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 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